Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 7
Trades: 0
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
 
 
Register now for full access!
Old 02-07-2005, 06:15 PM
easdesign.com's Avatar
Extreme Talker

Posts: 154
Trades: 0
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, 12:42 PM
Dark Incense's Avatar
Novice Talker

Posts: 7
Trades: 0
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, 01:05 PM
Average Talker

Posts: 17
Trades: 0
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, 01:05 PM
Average Talker

Posts: 17
Trades: 0
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, 01:08 PM
Super Moderator

Posts: 1,576
Location: Kokkola, Finland
Trades: 1
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 online now
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-08-2005, 03:31 PM
Dark Incense's Avatar
Novice Talker

Posts: 7
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.84474 seconds with 12 queries