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
Can you specify the paragraph hight with CSS?
Old 05-06-2007, 10:29 PM Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
Hey Guys,

I know you can specify the line heights by using "line-height: 20px;" but is there a way you can specify the hight of paragraphs using CSS?

Cheers guys & Gals.
swiftmed is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-07-2007, 01:08 AM Re: Can you specify the paragraph hight with CSS?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
No, you cannot specify paragraph heights. You''ll have to use line-height.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:18 AM Re: Can you specify the paragraph hight with CSS?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You could but much more importantly you shouldn't.
Code:
p {
     height:  60px;
     overflow:  hidden;
}
Doing so will create paragraphs 60 pixels high and only 60 pixels high. The problem with this method is that content that goes beyond this boundary cannot be seen; if either you put in a long block of text or your user enlarges his/her text sufficiently, your text won't be read.

overflow: auto could be used as well, but that creates scrollbars and that's just messy.

Why do you need your paragraph tag to be a specific height, anyway? Sounds like you're trying to be pixel perfect in an environment that won't allow for it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-07-2007, 01:21 AM Re: Can you specify the paragraph hight with CSS?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Good point Adam. I don't think I"ve ever even tried such a thing, there's just never been a need
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:27 AM Re: Can you specify the paragraph hight with CSS?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I have never tried it on purpose either, LNR. It was part of an accidental WordPress discovery (man, does that thing bastardize code sometimes.)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-07-2007, 12:25 PM Re: Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
hi guys, thanks for all the comments. the reason im asking is if you look at my new website at http://swiftmed.swiftmediauk.co.uk/website-design.php i am totally happy with the line height, however, the paragraps look really small, as if its just another line....what do you guys think? or is it just in my head?
swiftmed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 12:56 PM Re: Can you specify the paragraph hight with CSS?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
It's your font size. It's about 0.1em too small (and too light). It's difficult to read as a result. The line height itself is okay.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-07-2007, 12:59 PM Re: Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
thanks for your reply again adam, if you dont mind me asking, would you mind changing the following variables to what you would recommend using on my site please. this is the CSS entry for my text.

.page-content {
padding: 0px 4px 3px 3px;
color: #666666;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
line-height: 20px;
text-decoration: none;
}
swiftmed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:15 PM Re: Can you specify the paragraph hight with CSS?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
.page-content {
padding: 0px 4px 3px 3px;
color: #666666;
font-size: 70%; (slightly larger would be better)
font-family: Verdana, Arial, Helvetica, sans-serif;
line-height: 1.25em;
text-decoration: none;
}

It is best NOT to use PX sizes for text or line height. If you use PX, then IE users cannot re-size text should they choose to. Use percentages and/or em's instead.

Base text size for browser is 1em = 16px = 100%. So, to get 10px, divide 10/16 = .625%
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:42 PM Re: Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
Thankyou LadyInRed, i appreciate your advice. i ended up using the following:

}
.page-content {
padding: 0px 4px 3px 3px;
color: #666666;
font-size: 98%;
font-family: Verdana, Arial, Helvetica, sans-serif;
line-height: 1.90em;
text-decoration: none;

what do you think of the outcome - http://swiftmed.swiftmediauk.co.uk/website-design.php - any better?
swiftmed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:53 PM Re: Can you specify the paragraph hight with CSS?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
I'm still seeing 10px font sizes
It's also good to specify a base font size in your body declarations;

body{font-size: 100.1%}

or something like that.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 01:55 PM Re: Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
hiya,

yes i need to go round and change all my css definitions for different parts of the site and the menu etc, but do you think the main content on that page is much better sizes etc, or do you still feel its hard to read etc?
swiftmed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 07:58 PM Re: Can you specify the paragraph hight with CSS?
Experienced Talker

Posts: 36
Trades: 0
Easier to read, yes. But just as a tip, you need to catch your visitors attention and when I look at your page I don't know where to look or begin. Try making the text a little darker or something...
__________________

Please login or register to view this content. Registration is FREE
Phaaze is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 08:05 PM Re: Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
Quote:
Originally Posted by Phaaze View Post
Easier to read, yes. But just as a tip, you need to catch your visitors attention and when I look at your page I don't know where to look or begin. Try making the text a little darker or something...
Thankyou for your message Phaaze,

That is the impression i was also getting from my own website, and i think that is exactly what prompted me to ask for your guys advice. I have just done what you recommended and changed the colour of the text which now makes it a lot darker....do you think that makes a difference?

Also, can you recommend anything else i can change to make my site better / enhance it?

thanks for your advice in advance.
swiftmed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2007, 08:07 PM Re: Can you specify the paragraph hight with CSS?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
That's much better (assuming you mean the body copy). Now just apply the text change everywhere else and you're set.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-08-2007, 06:10 AM Re: Can you specify the paragraph hight with CSS?
Experienced Talker

Posts: 36
Trades: 0
Quote:
Originally Posted by ADAM Web Design View Post
That's much better (assuming you mean the body copy). Now just apply the text change everywhere else and you're set.

Agreed. Although there is one thing bugging the heck out of me.. The dark blue text on the header navigation rollover images... Why is the blue text so dark, doesn't match the rest of your site at all...
__________________

Please login or register to view this content. Registration is FREE
Phaaze is offline
Reply With Quote
View Public Profile
 
Old 05-08-2007, 09:49 AM Re: Can you specify the paragraph hight with CSS?
swiftmed's Avatar
Super Spam Talker

Posts: 905
Trades: 3
Quote:
Originally Posted by Phaaze View Post
Agreed. Although there is one thing bugging the heck out of me.. The dark blue text on the header navigation rollover images... Why is the blue text so dark, doesn't match the rest of your site at all...
Phaaze, could you please tell me where exactly you are talking about, because the only colour blue in my roll-over's are a light "sky blue" which are the same colour as the background to the site.
swiftmed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can you specify the paragraph hight with CSS?
 

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