[Extremely depressed] The Space bug after the display: inline label is added to the Li tag

Source: Internet
Author: User
Written at the beginning Code :

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Head >
< Meta HTTP-equiv = "Content-Type" Content = "Text/html; charsets = UTF-8"   />
< Title > Untitled document </ Title >
< Style Type = "Text/CSS" >
. Pagediv
{
Width
: 100% ;
Height
: 22px ;
Border
: 1px solid # cad9ea ;
Line-height
: 150% ;
Background-color
: # F7f7f7 ;
}
. Pagediv ul
{
Margin
: 0 ;
Padding
: 0 ;
List-style-type
: None ;
Text-align
: Center ;
}
. Pagediv ul Li
{
Border
: 1px solid #00ff00 ; /* A border is added to facilitate debugging. */
Display
: Inline ;
}
</ Style >
</ Head >
< Body >
< Div Class = "Pagediv" >
< Ul >
< Li > < A Href = "#" > Item 1 </ A > </ Li >
< Li > < A Href = "#" > Item 2 </ A > </ Li >
< Li > < A Href = "#" > Item 3 </ A > </ Li >
< Li > < A Href = "#" > Item 4 </ A > </ Li >
</ Ul >
</ Div >
</ Body >
</ Html >

After running, both in IE and FF show that there is a space on the right side, but the above Code has no errors based on personal experience. After debugging for two hours, I still do not know the reason, I checked Google and found out where the results were? < Ul >
< Li > < A Href = "#" > Item 1 </ A > </ Li >
< Li > < A Href = "#" > Item 2 </ A > </ Li >
< Li > < A Href = "#" > Item 3 </ A > </ Li >
< Li > < A Href = "#" > Item 4 </ A > </ Li >
</ Ul >

Change the above Code: < Ul >
< Li > < A Href = "#" > Item 1 </ A > </ Li > < Li > < A Href = "#" > Item 2 </ A > </ Li > < Li > < A Href = "#" > Item 3 </ A > </ Li > < Li > < A Href = "#" > Item 4 </ A > </ Li >
</ Ul >

That is, if you do not press enter to wrap the line, write it as a line. The problem is solved!
After the solution was completed, I was so angry that I could not find a single place. What is the bug !!!!
Depressed !! Most importantly, float: Left won't appear !!

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.