最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

簡(jiǎn)單實(shí)現(xiàn)柵格布局的兩種方式

  發(fā)布時(shí)間:2015-03-10 10:01:46   作者:佚名   我要評(píng)論
本文給大家介紹的是2種柵格布局的簡(jiǎn)單實(shí)現(xiàn)方式,并附上示例代碼,非常實(shí)用,這里推薦給大家,有需要的小伙伴參考下吧。

一、使用float:


復(fù)制代碼
代碼如下:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
section
{
border: solid 1px;
}
section section
{
float: left;
margin-left: 10px;
margin-top: 10px;
text-align: center;
width: 200px;
border-radius: 20px;
height: 200px;
}
.parent
{
height: 440px;
width: 660px;
}
.parent section:first-child
{
height: 410px;
}
</style>
</head>
<body>
<section class="parent">
<section>A</section>
<section>B</section>
<section>C</section>
<section>D</section>
<section>E</section>
</section>
</body>
</html>

二、使用display:flex(這個(gè)css3屬性僅谷歌和火狐支持)


復(fù)制代碼
代碼如下:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
section
{
border: solid 1px;
}
section section
{
margin-left: 10px;
margin-top: 10px;
text-align: center;
width: 200px;
border-radius: 20px;
height: 200px;
}
.parent
{
display: flex;
flex-direction: column;
flex-wrap: wrap;
height: 440px;
width: 660px;
}
.parent section:first-child
{
height: 410px;
}
</style>
</head>
<body>
<section class="parent">
<section>A</section>
<section>B</section>
<section>C</section>
<section>D</section>
<section>E</section>
</section>
</body>
</html>

 實(shí)現(xiàn)效果如圖所示:

當(dāng)然使用table和負(fù)邊距也是可以實(shí)現(xiàn)的,有時(shí)間補(bǔ)上:-D

以上就是本文所述的全部內(nèi)容了,希望大家能夠喜歡。

相關(guān)文章

最新評(píng)論

高安市| 宜城市| 朝阳县| 深水埗区| 宁夏| 马公市| 高邑县| 滦平县| 海南省| 西乌| 新疆| 西峡县| 昌黎县| 长阳| 嘉兴市| 东海县| 孙吴县| 新巴尔虎左旗| 苗栗市| 婺源县| 汶上县| 桃源县| 黄大仙区| 哈巴河县| 武宁县| 吴忠市| 策勒县| 兴海县| 陵水| 图片| 蒙自县| 长顺县| 宜君县| 临清市| 新郑市| 邵阳县| 汕头市| 华容县| 青龙| 洛宁县| 宾川县|