不喜欢bootstrap的栅格系统,太复杂了,我发明了一个最简洁的20列栅格系统

李彣辉 2016-03-05 04:20:51

最简洁的20列栅格系统。
但是还有有点小问题。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>栅格系统</title>
</head>
<style>
.row-fluid{width:1200px;margin:5px auto;background-color:yellow;}

/*.row-fluid .span* {float:left;margin:5px 1% 5px 1% ;}*/

.row-fluid .span20 { width:100%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span19 { width:94%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span18 { width:89%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span17 { width:84%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span16 { width:79%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span15 { width:74%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span14 { width:70%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span13 { width:64%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span12 { width:59%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span11 { width:54%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span10 { width:49%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span9 { width:44%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span8 { width:39%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span7 { width:34%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span6 { width:29%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span5 { width:24%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span4 { width:20%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span3 { width:14%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span2 { width:9%;float:left;margin:5px 1% 5px 0 }
.row-fluid .span1 { width:4%;float:left;margin:5px 1% 5px 0 }
</style>
<body >
<div style="width:1200px;margin:0 auto;background-color:gray;">
width:1200px;margin:0 auto;background-color:gray;
</div>

<div class="row-fluid">
<div style="background-color:blue;" class="span20">
span20 本来width=99%;<br/>
span*=列宽*列数+槽宽*(槽数)<br/>
=4%*20+1%*(20-1)<br/>
=99% 剩下1%手动加上去吧!!!
</div>
</div>

<div style="clear:both;">
</div>

<div class="row-fluid">
<div class="span6" style="background-color:red;">
span6
</div>
<div class="span6" style="background-color:red;">
span6
</div>
<div class="span8" style="background-color:red;">
span8 右边的1%没有使用<br>
span6+span6+span8<br/>
=29%+29%+39%<br/>
=99%,1%没用了?手动加上去就不好玩了!!!
</div>
</div>

</body>
</html>


我的网站 http://www.201603a.09-29.com/grid/grid.php
...全文
614 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
简单的码农 2019-01-02
  • 打赏
  • 举报
回复
这个有用不了。浮动都没有清除,这个用起来有点、
李彣辉 2017-05-25
  • 打赏
  • 举报
回复
引用 5 楼 gy127132060 的回复:
楼主的发明真牛,,,都没清除浮动。。真拿来用,,,早晚死你手上。。。
我做后端的,偶尔研究前端,教程里老师教直接套用,没说原理。所以吐槽那些视频教程。
香蕉猪 2016-03-22
  • 打赏
  • 举报
回复
楼主的发明真牛,,,都没清除浮动。。真拿来用,,,早晚死你手上。。。
fawdlstty 2016-03-08
  • 打赏
  • 举报
回复
bootstrap栅格系统并不复杂,这么简单还支持响应式,简直无敌了
业余草 2016-03-05
  • 打赏
  • 举报
回复
引用 1 楼 xiaofanku 的回复:
业余草 2016-03-05
  • 打赏
  • 举报
回复
街头小贩 2016-03-05
  • 打赏
  • 举报
回复

39,084

社区成员

发帖
与我相关
我的任务
社区描述
HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。
社区管理员
  • HTML5社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧