Summary of how to create fine lines in Div and CSS formatting

Source: Internet
Author: User

When I made the DIV height control today, I found that the height of the DIV controlled by IE is not valid when it is very small. I checked the related Article .

Finally, the solution is available. refer to the following article:

If you want to create a line with a height less than 12 PX (approximately), it will be displayed in IE higher than the actual height.

CopyCode The Code is as follows: <style>
. Line {
Background: # cccccc;
Height: 6px;
} </Style>
<Div class = "line"> </div>

It can be seen that the actual height is greater than 6px, which is also a bug in IE. The following three methods can solve this problem. The first method is recommended.
1:

Copy code The Code is as follows: <style>
. Line11 {
Background: # cccccc;
Height: 6px;
Overflow: hidden;
} </Style>
<Div class = "line11"> </div>

2. Add a space between the Div. Note: ie5.0 is invalid.
Copy codeThe Code is as follows: <style>
. Line12 {
Background: #336699;
Line-Height: 6px;
} </Style>
<Div class = "line12"> </div>

3:

Copy code The Code is as follows: <style>
. Line13 {
Background: # cc0000;
Height: 6px;
Font-size: 1px;
} </Style>
<Div class = "line13"> </div>
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.