css - 为何我看到很多人写的自适应网页外容器都没有设置width,只有类似section {display: block; }?
迷茫
迷茫 2017-04-17 12:05:52
0
3
867
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
Ty80

Block element width is 100%

刘奇

section is a new tag in HTML5, which represents a document section or section. This tag is used to make the code structure clearer and achieve semantic purposes; display:block; is used to define elements as block elements; block elements The default is to fill the entire line

刘奇

There are generally two methods

  • A method like bootstrap, which uses a container to set the width of the content area, and uses media queries to adapt to the screen. Then the content in the container is divided proportionally using row and col, so the section does not need a width,
    Another

  • The other is a full-screen layout, with no container or the container is 100% width
    A very important point for self-adaptation is not to specify the width of internal elements, because if the width is specified, it cannot be adapted.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template