What attributes does the li tag have? Detailed explanation of the attributes of li tag in css

云罗郡主
Release: 2018-11-07 14:19:21
Original
22585 people have browsed it

In html, we often encounter the li tag, so what are the attributes of the li tag? Let's take a look at the properties of the li tag in css.

1: What are the attributes of tags

In HTML, use the li tag in CSS to control the style. On many websites, click The beginning, sometimes in the form of a picture. li is the most basic attribute in HTML. The li tag is used in unordered and ordered lists. For example:

<ol> 
<li>php1</li> 
<li>php2</li> 
</ol> 
 
<ul> 
<li>php3</li> 
<li>php4</li> 
</ul>
Copy after login

The effect is as follows:

What attributes does the li tag have? Detailed explanation of the attributes of li tag in css

In the above code, you can see the default ordering and unordering of li. ol is arranged in ordered numbers, while the unordered ul is arranged in small dots. Currently, all browsers are compatible with li. [Recommended reading: javaScript dynamically adds Li elements]

2: Detailed explanation of the attributes of the li tag in css

Many Sometimes, we will add attributes to li to achieve the desired effect. We can arrange the elements horizontally or left-align the elements, or add colors to the list, for example:

ul{
    width:100%;
}
li{
    float:left;
}
Copy after login

We will use the above code You can arrange elements horizontally. If you want other effects, just modify the code directly.

The above is what are the attributes of the li tag? A detailed introduction to the attributes of the li tag in css. If you want to know more about CSS3 tutorial, please pay attention to the PHP Chinese website.


The above is the detailed content of What attributes does the li tag have? Detailed explanation of the attributes of li tag in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template