Home > Web Front-end > HTML Tutorial > DIV CSS slash effect_html/css_WEB-ITnose

DIV CSS slash effect_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:31:59
Original
1264 people have browsed it

DIV CSS slash effect is very simple, just set the border of CSS Border to have a slash effect. The code is shared with everyone so you can adapt it yourself.

http://www.admin10000.com Tips to pay attention to two points: 1. The definition of DIV width and height. 2. DIV has a height by default in IE6.

The right side of the above picture is the effect we want to achieve, the code is as follows:

<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>
Copy after login

It displays normally in FF IE7 IE8, but in IE6, it is as shown above As shown on the left, there is a gap in the middle, so you need to add a line:

line-height:0px;

The final code is as follows:

<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></head>
Copy after login

Please listen to Tencent for more Weibo: http://t.qq.com/admin10000_com

For more information, please follow Sina Weibo: http://weibo.com/admin1w

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