homepage Welcome to WebmasterWorld Guest from 54.204.127.191
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
Border margins on paragraphs
abushahin




msg:4391777
 8:33 pm on Nov 28, 2011 (gmt 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..

 

birdbrain




msg:4391815
 9:48 pm on Nov 28, 2011 (gmt 0)

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. ;)

birdbrain

lucy24




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

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.

[w3.org...]

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.

abushahin




msg:4391856
 12:52 am on Nov 29, 2011 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved