Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make border bottom inside block? [closed]

Tags:

css

How to make border-bottom inside block after hover event?

I tried this using text-shadow, but seems it is not solution

like image 259
Huligan Avatar asked Nov 29 '22 14:11

Huligan


1 Answers

An inset box shadow seems to be what you require

div {
  height: 75px;
  background: #c0ffee;
}

div:hover {
  box-shadow: inset 0 -5px 0 red;
}
<div></div>

OR

Use a pseudo-element

div {
  height: 75px;
  background: #c0ffee;
  position: relative;
}

div:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: red;
}
<div></div>
like image 181
Paulie_D Avatar answered Dec 06 '22 05:12

Paulie_D