Home > Web Front-end > HTML Tutorial > div height adaptive problem_html/css_WEB-ITnose

div height adaptive problem_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:57:00
Original
993 people have browsed it








dsadas


Increasing, how to achieve such self-increasing


Reply to the discussion (solution)
And I changed the float:left; in the page to margin : 0 auto; can be in main_all. This is the code I picked out from my page. When I don’t replace float:left; in the page with margin: 0 auto;, the css of the attachment will also become invalid.

Remove float:left;. You call this float collapse, or clearing the float.



<!DOCTYPE HTML><html><head> <style type="text/css">.main_all{border:1px solid red;width:1200px;margin: 0 auto;}.page{border:1px solid blue;width:1200px;float:left;height:40px;line-height:40px;text-align:center;}</style></head><body><div class="main_all"><div class="page">dsadas</div><div style="clear:both;"></div>   </div>   </body></html>  
Copy after login

Commonly used methods to clear floats


Thank you, God! ! ! !

Related labels:
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