Css + div image arrangement and layout

Source: Internet
Author: User

Let's take a look at the css div webpage layout as shown in the figure below. The analysis is composed of a large layer consisting of multiple li tags,

The following figure shows the div layout of the above figure.

<Div id = "face">
<Div id = "facetitle">
<Span> avatar list </span>
<Input id = "faceclose" type = "submit" value = ""/>
</Div>
<Ul id = "faceul">
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>
<Li> <a href = "#"> </img> </a> </li>

</Ul>
</Div>

The style is very concise, and div ul li is used to complete such a beautiful and regular webpage image layout. Let's see how css is written.

# Face {
Width: 300px;
Border: 1px solid # b4b4b4;
Height: 280px;
Margin: 0 0 0 50px;
Background: # ffffff;
}
# Face input {
Background: url (images/faceclose.gif) no-repeat center;
Margin: 0 0 0 140px;
Float: left;
Border: none;
Cursor: pointer;
Width: 30px;
Height: 30px;
}
# Facetitle {
Font-weight: bold;
Height: 30px;
Width: 292px;
Margin: 3px 0 0 3px;
Background: url (images/faceback.gif) repeat-x top left;
}
# Facetitle span {
Float: left;
Color: # ffffff;
Display: block;
Height: 30px;
Line-height: 30px;
Width: 100px;
Margin: 0 0 0 10px;
}
# Faceul {
Margin: 0 0 0 2px;
Width: 290px;
}
# Faceul li {
Float: left;
Border: 1px solid # b4b4b4;
Margin: 5px 0 0 4px;
Height: 52px;
Width: 50px;
}
# Faceul li {

Display: block;
Height: 52px;
Width: 50px;
}

# Faceul img {
Margin: 5px 0 0 5px;
Border: none;
Height: 40px;
Width: 40px;
}

We have defined face and then defined its sub-classes, such as li, a, and img ul.

Final statement: please indicate www.111cn.net/cssdiv/css.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.