Use DIV + CSS to create a diagonal line effect record, and use divcss to create a diagonal line.

Source: Internet
Author: User

Use DIV + CSS to create a diagonal line effect record, and use divcss to create a diagonal line.

The DIV + CSS diagonal line effect is very simple. You only need to set the Border of CSS Border to have a diagonal line effect. The code is shared with everyone, and you can make your own changes.

Note: 1. DIV width and height. 2. DIV has a height by default in IE6.

On the right side is the implementation result. The Code is as follows:

123456789101112 <div id="box"></div> <style type="text/css">#box{    width:0px; height:0px;    border:40px solid #000;    border-top-color:#930;    border-bottom-color:#0C3;    border-left-color:#FC0;    border-right-color:#009;}</style>

In FF IE7, IE8 is displayed normally, but in IE6, there is a gap in the middle, as shown on the left. Therefore, you need to add a line:

Line-height: 0px;

The final code is as follows:

123456789101112131415 <div id="box"></div> <style type="text/css">#box{     width:0px; height:0px;    border:40px solid #000;    border-top-color:#930;    border-bottom-color:#0C3;    border-left-color:#FC0;    border-right-color:#009;    line-height:0px;}</style>

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.