开发者

Is it better to use "min-height" always in place of height in css?

Should we always try to not to give "height" to elements in XHTML through CSS?

if yes the i think min-height would be better idea instead of fixed height.

What cross browser, W3C valid css, non-javascript "min-height" method in css for browser which do no开发者_JAVA技巧t support min-height?

if i add min-height to any tag example <div> then in future in more content comes in then will we have to change height of div or if min-height is defined then no need.

Should i use min-height always in place of height?


What cross browser, W3C valid css, non-javascript "min-height" method in css for browser which do not support min-height?

My workaround usually is to insert an element that does not disturb the rest of the content, and is min-height pixels high.

Should i use min-height always in place of height?

There are instances when you want a height to be fixed, for example with a container whose contents are to overflow: auto, so I would say no, definitely not.


No. There are plenty of times when it is sensible to use height. (Those times aren't when there is variable height content (including any kind of text) in elements without overflow set to non-default, but they exist).

What cross browser, W3C valid css, non-javascript "min-height" method in css for browser which do not support min-height?

The only browser that people really care about which falls into that group is IE6, and it has a bug in which it treats height and min-height for overflow: visible content anyway. So:

#foo { 
  height: 10em;
  min-height: 10em;
}

html>body #foo {
  height: auto;
}

… or use conditional comments.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜