Reply
CSS padding query
Old 02-07-2005, 05:12 PM CSS padding query
Dark Incense's Avatar
Novice Talker

Posts: 7
Hi,

Say I have assigned a CSS class to a paragraph tag <p>

and in that class, padding-left is set to 5%

but when the site renders, it only pads out paragraphs that extend beyond 1 line.

For example:

in stylesheet:

Code:
p.main {
  padding-right: 20%;
  padding-left: 5%;
  text-align: left;
  color: #666666;
  font-family: verdana;
  font-size: 7pt;
}

in htm doc:

Code:
<p class='main'>Hello This is one line</p><br><br>
<p class='main'>Hello this is more than one line, because it is a very logn sentence. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah </p>

this (^) renders (in FireFox) to this:

------

Hello this is one line

Hello this is more than one line, because it is a very long
sentence. blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah
blah blah



-------

Is it supposed to only pad multi line paragraphs? How can i make it pad single lines?

I dont get this problem in IE
Dark Incense is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 02-07-2005, 05:15 PM
easdesign.com's Avatar
Extreme Talker

Posts: 154
Do you have a link to the actual site I am kinda slow and need to see it laid-out =D
easdesign.com is offline
Reply With Quote
View Public Profile
 
Old 02-08-2005, 11:42 AM
Dark Incense's Avatar
Novice Talker

Posts: 7
http://www.neofate.co.uk

You can see the two single lines that are not indented, despite using the same css class as the main paragraph.
Dark Incense is offline
Reply With Quote
View Public Profile
 
Old 02-08-2005, 12:05 PM
Average Talker

Posts: 17
Using padding in <P> tag only applied to the 1st line. What you need to do is to put your paragraph inside a DIV container with padding-left: 5px;.
dexterz is offline
Reply With Quote
View Public Profile
 
Old 02-08-2005, 12:05 PM
Average Talker

Posts: 17
Using padding in <P> tag only applied to the 1st line. What you need to do is to put your paragraph inside a DIV container with padding-left: 5px;.


www.ex-designz.net
Dexter
dexterz is offline
Reply With Quote
View Public Profile
 
Old 02-08-2005, 12:08 PM
Webmaster Talker

Posts: 624
Location: Kokkola, Finland
it works if you replace it with margin (instead of padding)

incidentally Welcome to NeoFate, British Halo 2 Clan. should be a styled H1, seeing as it's a heading!
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-08-2005, 02:31 PM
Dark Incense's Avatar
Novice Talker

Posts: 7
Great, thanks guys! Im pretty new to CSS and proper web design, this is my first project using CSS in fact.
Dark Incense is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS padding query
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14012 seconds with 13 queries