Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add box shadowing to inputs in forms css?

Tags:

html

css

I have been trying to add some snazzy effects to my input boxes and one I found was box shadowing, I looked at the w3schools tutorial for box shadowing and tried multiple things to add it to my input box:

.l_input {
  box-shadow: 10px;
}

That didn't seem to work for my code. I also tried to use it using a hover pseudo effect and it again didn't work for that, the pseudo code I tried doing:

.l_input {
  box-shadow: 5px;
}
.l_input:hover {
  box-shadow: 10px;
  transition: 2s;
}

And again that didn't seem to work, if this is the right syntax for how the code should work or I am doing a small mistake thanks in advance, I have thought that maybe it isn't supported for inputs, but that sounded weird.

like image 283
Jack Hales Avatar asked Jan 13 '16 05:01

Jack Hales


People also ask

Is Box shadow supported by CSS?

The box-shadow CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.

How do you add shadow to text in CSS?

CSS Syntaxtext-shadow: h-shadow v-shadow blur-radius color|none|initial|inherit; Note: To add more than one shadow to the text, add a comma-separated list of shadows.

Can you add drop shadow in CSS?

We can add a drop shadow to any HTML element using the CSS property box-shadow .


1 Answers

.l_input  {
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: 0.3s ease-in-out;
}

/* hover effect  */
.l_input:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
<div class="l_input"> Content <div>
like image 147
Insomniac Avatar answered Sep 28 '22 10:09

Insomniac