Today, let's take a look at how the image uses div to arrange multiple rows and columns, as shown in the following figure.
The code is as follows: |
Copy code |
<Div id = "firstContent1"> <Div id = "AnLiLeft" class = "floatLeft"> <Div class = "AnLiPic"> <Div> <a href = "" target = "_ blank"> </a> </div> <Div class = "AnLiText"> <a href = "" target = "_ blank" title = "Changsha Hengtong maternal and child supplies Co., Ltd."> Changsha Hengtong maternal and child supplies Co., Ltd. </> </div> </Div> <Div class = "AnLiPic"> <Div> <a href = "" target = "_ blank"> </a> </div> <Div class = "AnLiText"> <a href = "" target = "_ blank" title = "Chinese enterprise website building platform"> Chinese enterprise website building platform </a> </div> </Div> <Div class = "AnLiPic"> <Div> <a href = "/" target = "_ blank"> </a> </div> <Div class = "AnLiText"> <a href = "/" target = "_ blank" title = "Changsha New Painting good Optoelectronics Co., Ltd."> Changsha New Painting good Optoelectronics Co., Ltd. </ a> </div> </Div> <Div class = "AnLiPic"> <Div> <a href = "/" target = "_ blank"> </a> </div> <Div class = "AnLiText"> <a href = "/" target = "_ blank" title = "Changsha Jiacheng Industrial Co., Ltd."> Changsha Jiacheng Industrial Co., Ltd. </ a> </div> </Div> <Div class = "AnLiPic"> <Div> <a href = "http://www.haihuigm.cn" target = "_ blank"> </a> </div> <Div class = "AnLiText"> <a href = "http://www.haihuigm.cn" target = "_ blank" title = "Hunan Haihui Industry & Trade Co., Ltd."> Hunan Haihui Industry & Trade Co., Ltd. </ a> </div> </Div> <Div class = "AnLiPic"> <Div> <a href = "http://www.hnyzgg.com.cn/" target = "_ blank"> </a> </div> <Div class = "AnLiText"> <a href = "http://www.hnyzgg.com.cn/" target = "_ blank" title = "Changsha art exhibition Advertising Co., Ltd."> Changsha art exhibition Advertising Co., Ltd. </> </div> </Div> </Div> |
Now let's see how css is defined.
The code is as follows: |
Copy code |
# FirstContent1 { Margin: 0px 2px 2px; Height: 249px! Important; Height: 248px; Background: # F2F2F2; } # AnLiLeft { Width: 520px; Height: 100%; } . AnLiPic { Margin: 10px 0px 0px 15px; Border: 1px solid # ccc; Float: left; } |
I will not talk about other things in this simple way. I only declare that the original article on this site is reprinted, please note: www.111cn.net/cssdiv/css.html