Box-Sizing on input button does not work

Asked

Viewed 29 times

0

inserir a descrição da imagem aqui

Guys, I have a form where when I apply a border-bottom to the input button it jumps because the box-Sizing is not working (I believe that’s it). In other input is working properly. Can anyone help me?

1 answer

0


A hint, use box-shadow in place of border. First time the box-shadow does not occupy moonlight in the box-model and will not shift or move its element, after the transition of the box-shadow is usually better rendered and is smoother than the border transition. So making a box-shadow: inset you place the shadow inside the button, giving the impression that it is a border.

inserir a descrição da imagem aqui

[type="button"] {
	all:unset;
	background-image: linear-gradient(to bottom, blue 0%, royalblue 100%);
	color: #fff;
	width: 100px;
	height: 50px;
	border-radius: 4px;
	text-align: center;
  cursor:pointer;
	transition: box-shadow 250ms;
}
[type="button"]:hover {
	box-shadow: inset 0 -4px 0 red;
}
<input type="button" value="login">

  • Thank you! I didn’t even know this property

  • @Renanvilela this property is very useful then take some time to study it. If you think the answer solves the problem remember to mark it as accepted in this icon below the arrow , then if another answer appears that you think is more appropriate you can change to it

Browser other questions tagged

You are not signed in. Login or sign up in order to post.