Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep bottom outline (focus border) only? [duplicate]

I'd like to remove left, right and up outlines, leaving only the bottom outline.

for example:

 input
_______

I know we can remove ALL outlines using this way:

<input style="outline: none" >

Is there any way to keep the bottom outline?

like image 394
Amy Avatar asked Nov 07 '25 01:11

Amy


1 Answers

You can't do that. According to w3schools

Outlines differ from borders! Unlike border, the outline is drawn outside the element's border

It applies to the whole element.

You could try box-shadow perhaps

input {outline: none; border:none; border-bottom: 1px solid orange;}
input:focus{box-shadow: 0 1px 0 0 blue;}
<input type="text" placeholder="name">
like image 111
Viira Avatar answered Nov 09 '25 19:11

Viira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!