DEV Community

CSS Border Length

Eduard Pochtar 👨‍💻 on November 29, 2018

CSS is great, it's simple and it's really easy to understand it. Of course despite it's awesome, it still has some missing features like for exam...
Collapse
 
nmaxcom profile image
Carles Alcolea

You gave me hope when I read border-bottom-length. Now... Now I feel empty.

Collapse
 
marvinkweyu profile image
Marvin

You too? lol. Same boat

Collapse
 
ikbensiep profile image
Sibrand Hoekstra • Edited

This idea would probably need to introduce some kind of border-origin property for those who do not want their custom-length border to start in the center.

Which then leads me to think that a border pretty much defines an area so I think this should not be handled by a border but perhaps a good old <hr />

Collapse
 
iamfrntdv profile image
Eduard Pochtar 👨‍💻 • Edited

Absolutely agree with border-origin, which can accept values like "start", "center/middle", "end".

The problem with hr that it can work good horizontally but not vertically.. And border can work in both directions.

Collapse
 
danaustinweb profile image
Daniel Austin • Edited

with the [transform: rotate()] and [position: absolute], you can push the <hr /> tag(s) to any position of the parent element with a [position: relative].

So which ever is sutaible for the user, either your second method or using the <hr />, all is still save...

Collapse
 
lalov1 profile image
Lallo Vigil

Who didn't read the article and copied border-bottom-length too?

Collapse
 
grepliz profile image
Liz Lam

I agree. It's unfortunate we are unable to control border lengths. I definitely like your idea!