+ 3
How to Add Shadow in a DIV using CSS ?
@saurav_kumawat @i_m_srv_
4 ответов
+ 2
eg. box-shadow: 1px solid #999;
+ 1
<div class="classname">CONTENT</div>
In CSS:
.classname {
height: 50px;
width: 50%;
background-color: lightblue;
box-shadow: 2px 2px 2px rgba(0,0,0,1);
}
First number is the X offset. Second is Y. Third is the spread. RGBA is the color (with alpha) of your choice. 1 is opaque. 0 is transparent.
You can also switch the class with id by changing class to id, and the '.' selector to a # (i.e. from .classname{} to #classname{} )
Feel free to play with it here: https://jsfiddle.net/Lowtn2qw/
0
use box-shadow
0
try box-shadow: 0 0 4px 4px #456aaa
1px solid #999 - its for borders :)