最新国产好看的视频,伊人天堂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

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

相關(guān)文章

最新評(píng)論

宣威市| 左权县| 铁力市| 鄱阳县| 翁牛特旗| 通辽市| 乐至县| 靖江市| 济源市| 静宁县| 临沧市| 新疆| 新疆| 东辽县| 泗阳县| 延寿县| 辽宁省| 正蓝旗| 正定县| 会理县| 阜阳市| 象山县| 吉木萨尔县| 墨玉县| 定南县| 左云县| 简阳市| 千阳县| 德阳市| 鹰潭市| 忻州市| 合作市| 定陶县| 汶川县| 彭泽县| 云阳县| 镇江市| 隆德县| 福清市| 合作市| 新和县|