p.one {border-style: solid;border-width: 15px;border-left-color:red;min-height:50px;}...
这样不同颜色的边框的角 不同颜色交界的地方 会看出来 很明显的斜线
如和能实现这样的效果
回复讨论(解决方案)
两种办法,一种是直接插入一个明标签,另外一种是用after这个选择器。
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; }...
这种效果,使用CSS3的方式就简单多啦
如果不嫌麻烦,嵌套一层,兼容新旧浏览器:
.ps{border-left:15px red solid;} /* 外层 左边框 */
p.one {
border-style: solid;
border-width: 15px;
border-left:none;
min-height:50px;
position:relative;
}
...
查看更多关于边框上下左右不同颜色的问题_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did109063