CSS布局

作者: RickyWu585 | 来源:发表于2020-06-18 21:08 被阅读0次
image.png

float布局

  • 步骤
  1. 子元素上加 float:left 和 width
  2. 在父元素上加 .clearfix(重要)
  content:  '';
  display:  block;
  clear:  both;
}
image.png
  • border调试时可能会干扰布局,这时可以用outline替代。

  • 块级元素且宽度固定,如果要居中:
    margin:0 atuto;
    margin-left:auto; margin-right:auto;
    更好

http://js.jirengu.com/xilodiqipe/16/edit?html,css,output

相关文章

网友评论

      本文标题:CSS布局

      本文链接:https://www.haomeiwen.com/subject/jgspxktx.html