user2058041
user2058041

Reputation: 41

How can I get a very "blurred" box-shadow out of only the bottom of the box?

My goal is to do this with pure css.

I am trying to make my box shadow with a very big shadow blur like this:

box-shadow: 0 0px 200px -2px #888;

Below the box, it looks awesome, but above now it's darkening the entire page. How can I make a super big blur without this darkening?

Upvotes: 0

Views: 276

Answers (2)

Bill
Bill

Reputation: 3517

I came up with this using this CSS3 Generator

-webkit-box-shadow: inset 0px -350px 200px -250px rgba(5, 5, 5, 1);

        box-shadow: inset 0px -350px 200px -250px rgba(5, 5, 5, 1);

This is a very cross-browser friendly method and if you apply a background color it will achieve what I believe is your desired result.

Check out this jsFiddle

Source(s)

CSS3 Generator

Upvotes: 0

decden
decden

Reputation: 719

The best way to go about this might be, to use css-gradients instead of shadows.

I have done a little demo on jsfiddle. I am not sure this is what you are looking for though. Here is the css I used:

background: rgb(254,255,255); /* Old browsers */
background: -moz-linear-gradient(top,  rgba(254,255,255,1) 69%, rgba(226,226,226,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(69%,rgba(254,255,255,1)), color-stop(100%,rgba(226,226,226,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  rgba(254,255,255,1) 69%,rgba(226,226,226,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  rgba(254,255,255,1) 69%,rgba(226,226,226,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  rgba(254,255,255,1) 69%,rgba(226,226,226,1) 100%); /* IE10+ */
background: linear-gradient(to bottom,  rgba(254,255,255,1) 69%,rgba(226,226,226,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feffff', endColorstr='#e2e2e2',GradientType=0 ); /* IE6-9

As generated by this tool

Upvotes: 1

Related Questions