div+css如何实现最小高度。_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:29:08
Original
1264 people have browsed it

要求:在不同的浏览器下,要求字多的时候,框会自动延伸,字少的情况下是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}
Copy after login

  

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>
Copy after login

 

 

 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!