Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Border margins on paragraphs

8:33 pm on Nov 28, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 20, 2009
posts: 98
votes: 0

Hi all
Ive got paragraphs that have borders

<p style="background-color:#F5F5F5;border-radius: 5px 5px 5px 5px;text-align:justify;">blah blah blah..</p>

as you can see it has a colour in the background the problem is the text is very close to the edge i was wondering if there was a way to add margin to the paragraph i.e.

<p style="background-color:#F5F5F5;border-radius: 5px 5px 5px 5px;text-align:justify;margin-left:10px;">blah blah blah..</p>

obviously that doesnt work, i dont want to put it in a div as that will mess up the presentation. any ideas appreciated..
9:48 pm on Nov 28, 2011 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 2, 2003
posts: 989
votes: 31

Hi there abushahin,

margin-left:10px effects the position of the p element.

To effect the text position within the p element use padding-left:10px. ;)

11:52 pm on Nov 28, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
votes: 553

And then go back and put it all in your CSS where it belongs ;)

p.fuzzy {background-color:#F5F5F5; border-radius: 5px 5px 5px 5px; text-align:justify; padding-left:10px;}

Why are there four values for border-radius? I'd expect two-- or just one, since they're the same.


If possible, also think about expressing your radius and padding in ems, since this may come out more consistent across different browsers with different user prefs.
12:52 am on Nov 29, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 20, 2009
posts: 98
votes: 0

thanks guys!
I tried that few weeks ago and it didnt work mustve been the caching on the browser!
and thanks for the tip about consistency with ems! much appreciated.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members