Ul labels are often used by us, but since I am used to using IE, I do not care about the effect of running it in other browsers, after Firefox is recommended by others, ul is not compatible with IE and Firefox. ul has a padding value in Firefox, but not in IE, on the contrary, there is a margin value in IE, but it does not exist in Firefox. We can use the following example to confirm it.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<Meta name = "Generator" CONTENT = "EditPlus">
<Meta name = "Author" CONTENT = "">
<Meta name = "Keywords" CONTENT = "">
<Meta name = "Description" CONTENT = "">
<Style type = "text/css">
Body {
Font-size: 12px;
Margin: 20px;
Line-height: 18px;
}
# Box {
Width: 200px;
Background: gray;
Border: white 1px solid;
}
# Box ul {
Padding: 0;
Margin: 0;
List-style: none;
}
</Style>
</HEAD>
<BODY>
<Div id = "box">
<Ul>
<Li> This is the first sentence </li>
<Li> This is the second sentence </li>
<Li> This is the third sentence </li>
<Li> This is the fourth sentence </li>
<Li> This is the fifth sentence </li>
</Ul>
</Div>
</BODY>
</HTML>
The above code runs in Firefox and IE. To see their differences, you can set the style # box ul {padding: 0; margin: 0; list-style: none ;} the padding and margin in are called for testing respectively. The code is not pasted here. You can modify the code to understand their differences. Note that ul's list-style in Firefox is at the outer edge by default. You can use CSS to change this style (list-style: inside) to ensure IE compatibility. (This is my personal understanding. please correct me if you have any mistakes ).