I have following code
div {
width:200px;
border-bottom:1px solid magenta;
height:50px;
}
The div width is 200px so border-bottom is also 200px but what should I do if I want border-bottom only 100px without changing div width?
csshtml
I have following code
div {
width:200px;
border-bottom:1px solid magenta;
height:50px;
}
The div width is 200px so border-bottom is also 200px but what should I do if I want border-bottom only 100px without changing div width?
Best Answer
You can use pseudoelements. E.g.
No need to use extra markup for presentational purpose. :after is also supported from IE8.
edit:
if you need a right-aligned border, just change
left: 0
withright: 0
if you need a center-aligned border just simply set
left: 50px;