The problem of different colors for the top, bottom, left and right borders_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:38:55
Original
1919 people have browsed it

<html><head><style type="text/css">p.one {border-style: solid;border-width: 15px;border-left-color:red;min-height:50px;}</style></head><body><p class="one">...</p></body></html>
Copy after login


In this way, the corners of the borders of different colors and the intersection of different colors will see obvious slashes
Ruhe can achieve such an effect


Reply to the discussion (solution)

There are two ways, one is to directly insert a clear tag, the other is to use the after selector.

<!DOCTYPE html><html><head>    <style type="text/css">        p.one{            border-style: solid;            border-width: 15px;            min-height:50px;            position:relative;        }        p i{ position:absolute;min-height:80px;width:15px;top:-15px;left:-15px;background:red;}        p:after{            content:'';position:absolute;min-height:80px;width:15px;top:-15px;right:-15px;background:red;        }    </style></head><body><p class="one"><i></i>...</p></body></html>
Copy after login

This effect is much simpler using CSS3

If you don’t mind it, nest one layer to be compatible with old and new browsers:







...








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