In CSS layout, the use of ul,li is very common. With Div and CSS, create no table layout.
In fact, Dreamweaver also has a sample of the CSS layout, as shown in the following figure:
- The format of the Li code:
A). Using CSS to format list characters: UL li{
List-style-type:none;
For example, the following:
- Supply and demand information
B). If you want to change the list character to an image, then: UL li{
List-style-type:none;
List-style-image:url (images/icon.gif);
For example, the following:
- Supply and demand information
C). To align Left, you can use the following code: ul{
List-style-type:none;
margin:0px;
For example, the following:
- Supply and demand information
D). If you want to add a background color to the list, you can use the following code: ul{
List-style-type:none;
margin:0px;
}
UL li{
Background: #CCC;
For example, the following:
- Supply and demand information
E). If you want to add mouseover background color effect to the list, you can use the following code: ul{list-style-type:none; margin:0px;}
UL Li a{display:block; width:100% background: #ccc;}
UL Li a:hover{background: #999;} description: Display:block; this line must be added, so as to block the display!
For example, the following:
- Supply and demand information
F). The elements in Li are arranged horizontally, the key float:left:ul{
List-style-type:none;
width:100%;
}
UL li{
width:80px;
Float:left;
}