Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-12-2009, 02:06 PM   PM User | #1
ksanjanadevi
New Coder

 
Join Date: Oct 2008
Location: India, Banglore
Posts: 50
Thanks: 1
Thanked 0 Times in 0 Posts
ksanjanadevi is an unknown quantity at this point
when and where to use these in css?

1) when do we use line-height and height? (In menus (ul,li) do we use height or line-height?)
2) when do we use % and pixel?
3) when do we use
Code:
position:relative
and
Code:
position:absolute
? are they supportive for IE?
4) when do we use float and clear function?
5) Using use tables when div's are not aligned properly is right method?


These all problems I face in my current project, Please clarify me with this so that its very helpful to align my work..
ksanjanadevi is offline   Reply With Quote
Old 05-12-2009, 02:28 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
The line-height property is for the height of a line (how ironic), usually this applies to text. The lines of the text will be spaced out vertically if you increase the line height (i. e. the lines become higher) while the height property specifies the height of an element (it’s a difference if you increase the height of the lines in a paragraph or the height of the paragraph itself).

For lists I would suggest using height, perhaps together with some top and bottom padding for the list items (or perhaps scrap the fixed height and just apply some top and bottom padding). Line height can be useful as well but might become problematic with cross browser compatibility or if the text in the list items wraps.

If you use percents or pixels as values is completely your choice. If you want a liquid layout (adapting to the size of the viewport) or a layout that keeps the dimensions relative to the size of the viewport you should use relative units such as percent, em, or ex. If your layout is static you should use absolute units such as px (pixels), cm (centimeters), in (inch), mm (millimeters), pt (points), or pc (picas). These latter ones are probably more useful for print layouts so the px unit would be the most appropriate for screen layouts. Also refer to http://www.w3schools.com/css/css_units.asp Note that you can mix any of the units. For example you can specify your general page width in pixels and then specify widths of child elements in percents which relate to the width of the parent.

I don’t have the time to explain the other stuff right now as it’s a little more involved.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
ksanjanadevi (05-12-2009)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:33 PM.


Advertisement
Log in to turn off these ads.