Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS for gradient box shadow and borders

Tags:

html

css

gradient

Is it possible to do this in CSS:

enter image description here

like image 372
Pauly Dee Avatar asked Oct 18 '11 20:10

Pauly Dee


1 Answers

here's my 2 cents:

HTML:

<div class="upperDiv"></div>
<div class="lowerDiv"></div>

CSS:

.upperDiv {
width:500px;
height: 40px;

background-image: -ms-radial-gradient(center bottom, ellipse farthest-corner, #E4E4E4 0%, #FDFDFD 150%);
background-image: -moz-radial-gradient(center bottom, ellipse farthest-corner, #E4E4E4 0%, #FDFDFD 150%);
background-image: -o-radial-gradient(center bottom, ellipse farthest-corner, #E4E4E4 0%, #FDFDFD 150%);
background-image: -webkit-gradient(radial, center bottom, 0, center bottom, 567, color-stop(0, #E4E4E4), color-stop(1.5, #FDFDFD));
background-image: -webkit-radial-gradient(center bottom, ellipse farthest-corner, #E4E4E4 0%, #FDFDFD 150%);
background-image: radial-gradient(center bottom, ellipse farthest-corner, #E4E4E4 0%, #FDFDFD 150%);

}

.lowerDiv {
width:500px;
height: 40px;

background-image: -ms-radial-gradient(center top, ellipse farthest-corner, #FDFDFD 0%, #F0F0F0 80%);
background-image: -moz-radial-gradient(center top, ellipse farthest-corner, #FDFDFD 0%, #F0F0F0 80%);
background-image: -o-radial-gradient(center top, ellipse farthest-corner, #FDFDFD 0%, #F0F0F0 80%);
background-image: -webkit-gradient(radial, center top, 0, center top, 567, color-stop(0, #FDFDFD), color-stop(0.8, #F0F0F0));
background-image: -webkit-radial-gradient(center top, ellipse farthest-corner, #FDFDFD 0%, #F0F0F0 80%);
background-image: radial-gradient(center top, ellipse farthest-corner, #FDFDFD 0%, #F0F0F0 80%);
}

The width and height are there just so you can see something. I think this will work on most modern browsers (though it's a bit verbose)

like image 99
Francisco Paulo Avatar answered Sep 25 '22 08:09

Francisco Paulo