Is there any way that I can have 4 different colours on one side of a border in CSS? I currently have
#header
{
border-color:#88a9eb;
}
I w
You can use box-shadow
and after
psuedo-element
to do this
What I did:
I first created an :after
element on the bottom, then added box-shadow
s horizontally with different colors
If you want to change the strength of the border simply give more height to the :after
element
div {
width: 200px;
height: 100px;
position: relative;
background: grey;
}
div:after {
bottom: 0;
position: absolute;
content: "";
width: 50px;
height: 5px;
background: green;
box-shadow: 50px 0 0 0 red, 100px 0 0 0 orange, 150px 0 0 0 green;
}
Same thing on a larger div
will be like this
div {
width: 500px;
height: 100px;
background: orange;
position: relative;
}
div:after {
bottom: 0;
position: absolute;
content: "";
width: 100px;
height: 5px;
background: green;
box-shadow: 100px 0 0 0 darkred, 200px 0 0 0 red, 300px 0 0 0 yellow, 400px 0 0 0 tomato;
}