CSS Tutorial: Li and ul tag usage examples

Source: Internet
Author: User

The format of the Li code:
A). Use CSS to format list characters: ul li{
List-style-type:none
}
B). If you want to change the list character to an image, then: UL li{
List-style-type:none
List-style-image:url (/blog/images/icon.gif);
}
C). To align Left, you can use the following code: ul{
List-style-type:none
margin:0px;
}
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;
}
E). If you want to add a 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!

F). The elements in Li are arranged horizontally, with the key float:left:ul{
List-style-type:none;
width:100%;
}
ul li{
width:80px
Float:left;
}

<LI> parameter setting (commonly used):
For example: <li type= "Square" value= "4" >

Type= "Square"
Only applicable to the non-standard list, set the symbol style, its value has three kinds, such as the following, the default for Type= "disc":
A symbol is a column-entry symbol when type= "disc".
The symbol if "width=10 height=10 border=0> is a column-entry symbol when type=" circle ".
A symbol is a column-entry symbol when type= "square".
Value= "4"
Only applies to the sequential list, the number of that item is set, and the items are incremented by this as the starting number, but the previous items are unaffected and the value can only be 1,2,3. Equal integers, no default values.
<UL> called unordered list tags.
The so-called unordered list is in front of each item plus,, and other symbols, it is also called symbol list.
<UL> parameter setting (commonly used):
For example: <ul type= "Square" >

Type= "Square"
Set the symbol style, its value has three kinds, as follows, the default is Type= "disc":
A symbol is a column-entry symbol when type= "disc".
A symbol is a column-entry symbol when type= "circle".
A symbol is a column-entry symbol when type= "square".

<ul> is the list of items,<li> is a list item, the list of items is listed by the symbol, so you list the default is black dot, there is a <ol> this is a numbered list, with the number of columns, but also with <li> do list items


<li> is a list item, but there are two types of lists, so there must be <ul> or <ol> used to distinguish between unordered tables (small dots) and ordered lists (1,2,3 ...).

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.