Quantcast
Channel: The Graphic Web Design, Art, Music and words of Houston webmaster Dwayne Casey. » Web Design
Viewing all articles
Browse latest Browse all 10

Web Design Tip — Setting div height with CSS

$
0
0
I have run into a few issues using the height attribute to set the height of div containers in recent past projects. While this worked quite well with static text that was not slated to change. It has become a problem if that text gets an update. For example: Now, I have a good rule of thumb in which to use in all future cases that I can think of. The fix: Use the min-height CSS attribute. If you need to set a height, in some cases you may just avoid the height all together, Min-height works much better because you are simply stating that this element needs to be a minimum of X pixels high. If the amount is greater than that., the element will grow in most cases or allow for expansion. When using the height attribute, I have noticed that the element does not grow and if the text copy is either increased in font size or text count, then copy tends to get cut-off. This can cause frustration for clients, therefore my recommendation is to utilize min-height for all future situations where an element might possibly grow. Or if at all possible avoid using a height setting at all.

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images