div+css如何?最小高度。

來源:互聯網
上載者:User

要求:在不同的瀏覽器下,要求字多的時候,框會自動延伸,字少的情況下是200px,字沒有的情況下還是這個高度。此例子主要用了(!important)

 

CSS代碼:

 

*{padding:0; margin:0}body{ font-size:30px;padding:100px}.box{width:300px; height:auto !important; min-height:200px;border:5px solid #000000}

  

HTML代碼:

 

View Code

 1 <div class="box"> 2 smart工作室<br /> 3 smart工作室<br /> 4 smart工作室<br /> 5 smart工作室<br /> 6 smart工作室<br /> 7 smart工作室<br /> 8 smart工作室<br /> 9 smart工作室<br />10 smart工作室<br />11 smart工作室<br />12 smart工作室<br />13 smart工作室<br />14 smart工作室<br />15 </div>

 

 

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.