html – 在Opera中使用100%min-height,但在其他浏览器中不能

前端之家收集整理的这篇文章主要介绍了html – 在Opera中使用100%min-height,但在其他浏览器中不能前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我正在使用的代码
  1. html,body{
  2. height: 100%;
  3. }
  4.  
  5. div{
  6. min-height: 100%;
  7. height: auto !important;
  8. height: 100%; /* this is for older IE */
  9. }

http://jsfiddle.net/YYcLJ/

这也失败了(但在Opera中有效):

  1. div{
  2. min-height: 100%;
  3. height: auto;
  4. }

所以100%的高度应该应用于所有div,直到html.但这只发生在第一个DIV

猜你在找的HTML相关文章