公告
财富商城
积分规则
提问
发文
2019-04-15 11:18发布
做自己的国王
I need to create border bottom with two different color like below picture
how to create the css ?
thx u
use box-shadow with zero blur
syntax : box-shadow : x-offset y-offset blur radius color
example : box-shadow 0 0 0 1em red , 0 0 0 2em orange.
this will emulate a border of 1em red border and then a 1em orange border.
Note that orange color has a radius of 2em ( because half of it will be covered by red color)
You can use css pseudo classes i.e :after or :before.
:after
:before
h3 { margin: 0; padding-bottom: 7px; position: relative; border-bottom: 2px solid #ccc; } h3:before { position: absolute; background: brown; height: 2px; content: ''; width: 50px; bottom: -2px; left: 0; }
<h3>Last Recent Post</h3>
And you can use css gradient as well:
h3 { margin: 0; padding-bottom: 7px; position: relative; } h3:before { position: absolute; background: linear-gradient(to right, brown 50px, #ccc 50px); height: 2px; content: ''; bottom: 0; right: 0; left: 0; }
最多设置5个标签!
use box-shadow with zero blur
syntax : box-shadow : x-offset y-offset blur radius color
example : box-shadow 0 0 0 1em red , 0 0 0 2em orange.
this will emulate a border of 1em red border and then a 1em orange border.
Note that orange color has a radius of 2em ( because half of it will be covered by red color)
You can use css pseudo classes i.e
:after
or:before
.And you can use css gradient as well: