CSS - Border bottom length fixed to 60% -
this question has answer here:
- border length smaller div width? 10 answers
i need on border-bottom length. want set border-bottom length 60%. can using inner div like:
#mydiv { background: #fed; _border-bottom: 5px solid red; } #mydiv div { margin: 5px 0px; width: 60%; height: 5px; background-color: red; }
<div id="mydiv"> div <div></div> </div>
but don't want use div, want achieve using border-bottom, search in google , stack no luck.
thanks in advance.
you can use pseudo element this:
#mydiv { background: #fed; position: relative; } #mydiv::after { content: ""; width: 60%; height: 5px; background: red; position: absolute; bottom: -5px; left: 0; }
<div id="mydiv"> div </div>