百科问答小站 logo
百科问答小站 font logo



以下 CSS 栅格布局除了用 table 以外,有什么其他的方法吗? 第1页

  

user avatar   Ivony 网友的相关建议: 
      

flexible box,你值得拥有:


       <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   <title></title>   <style>       .flex-container       {         display: flex;         flex-direction: column;         flex-wrap: wrap;         height: 440px;         width: 660px;       }          .flex-container section         {           box-sizing: border-box;           padding: 10px;           margin: 10px;           width: 200px;           height: 200px;           border: solid 1px;           border-radius: 5px;         }            .flex-container section:first-child           {             height: 420px;           }   </style> </head> <body>   <section class="flex-container">     <section>A</section>     <section>B</section>     <section>C</section>     <section>D</section>     <section>E</section>   </section>  </body> </html>      

基本上table布局能做到的,flexible box也都能做到,但flexible box的优越性在于可以彻底的分离布局和内容,就像上面这样。




  

相关话题

  前端拿到后端的数据,不能直接用,还要再处理,这样合理吗? 
  当人们说一个前端框架太“厚重”时,他们在说什么? 
  如何保证用户登录时提交密码已经加密? 
  HTML5标准完工意味着什么? 
  为什么childNote.length获取不到body标签的最后一个#text? 
  西安电信一码通项目此前报道中提到「两天两夜把 1m 图片优化到100kb」,图像压缩技术难度是怎样的? 
  你见过哪些奇趣的代码注释? 
  为什么 CSS 这么难学? 
  Chrome 会成为下一个 IE 6 吗? 
  前端同事被富婆包养了,在深圳买了房,他代码技术远不如我,现在心里很不平衡,如何调节自己? 

前一个讨论
Java 8的新特性lambda表达式是否比匿名内部类具有更好的可读性?
下一个讨论
为什么苹果能进入中国并且生存得很好,而谷歌却不行?





© 2024-09-19 - tinynew.org. All Rights Reserved.
© 2024-09-19 - tinynew.org. 保留所有权利