Archive Pages Design$type=blogging

How to make Box Shadow without images

Hi Every one on Free TUTS . Today we've a css3 Tutorials which is how to make a Box shadow without using images. First let's take a ...

Hi Every one on Free TUTS.


Today we've a css3 Tutorials which is how to make a Box shadow without using images.
First let's take a look at the filanle Resul :

Check out this Pen!



So Let's Begin:

First Step:

Take this simple html code:

<div class="drop-shadow">
Box Shadow <a href="http://www.free-premiumhtml.tk">Free Premium HTML</a>
</div>
Check out this Pen!


As you can see it's a simple div with a simple paragraph inside of it there's and anchor tag, pretty simple, hein.

Step Two:

Here we'll begin with css coding.

As what I've writen above, this box shadow will be with no images, in this effect I've used the "After" & "Before pseudo-class, and the css3 element "Transform"

Lets begin with the div styling:

.drop-shadow {
   position:relative;
 width:500px;
  height: 150px;
  background :#e3e3e3;
  color : rgba(0,0,0,.4);
  text-align : center;
  line-height : 150px;
  margin : 0 auto;
  color : rgba(0,0,0,.5);
  font-family : Tahoma;
  text-shadow : 0 1px 0 #fff;
}
.drop-shadow a{
  text-decoration : none;
  color : #999999;
  font-family : Tahoma;
Everything is a simple styling, the only thing that can confuse you is "Position:Relative", this will help you to move the elements of the pseudo-classes as you want.

Step Three:

Now we'll move to the pseudo-classes styling:
.drop-shadow:before,
.drop-shadow:after {
   content:"";
   position:absolute;
   z-index:-1;
   bottom:15px;
   left:10px;
   width:50%;
   height:20%;
   max-width:300px;
   -webkit-box-shadow:0 15px 10px rgba(0, 0, 0, 0.7);
   -moz-box-shadow:0 15px 10px rgba(0, 0, 0, 0.7);
   box-shadow:0 15px 10px rgba(0, 0, 0, 0.7);
   -webkit-transform:rotate(-3deg);
   -moz-transform:rotate(-3deg);
   -o-transform:rotate(-3deg);
   transform:rotate(-3deg);
}

Code Explaining: 

"Position: Asbolute": this will reset the positioning of the element and will be relative to its parent which is in our example the "drop-shadow" div.
"z-index : -1": this is most likely the layers in the photoshop, this means that this element will be behinde the parent element which is in our example the "drop-shadow" div.
"Box-shadow": you can read about this on W3School, and I've used this element on : Stack images with cool effect just with pure css3.
Now let's go to the Transform element:
"transform:rotate(-3deg);" : this means to rotate thie div with (-3deg), so that it give that effect, also you can read about this element from W3School.
The other styling is a simple styling to the element, like the width, height, and the margins...

Step Four:

And now let's complete the effect width the other element:

.drop-shadow:after{
   right:10px;
   left:auto;
   -webkit-transform:rotate(3deg);
   -moz-transform:rotate(3deg);
   -o-transform:rotate(3deg);
   transform:rotate(3deg);
 }
This  coding is generaly like the previous styling except the "left:auto", and this is to make the div position to the left.

Finally:

Here is the final result:

Check out this Pen!


Hope you enjoy it.
See you in the next Post, baybay ^_^

COMMENTS

Name

ALL android Apple articles Build free website CSS Downloads DVD exclusive facebook freebies fun games giveaways google HTML internet iPhone iPhone 6 iPhone 6 Plus iPhone 6s kali linux leaks linux Microsoft News Offers opensource php psd Quick Tips Samsung Series Skype Templates Tips tools Tooltips tricks Tutorials Videos VPN windows Youtube
false
ltr
item
Sticky TUTS | When Technology meets pleasure: How to make Box Shadow without images
How to make Box Shadow without images
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxWUsRDXzNPGBGq1ai2bgvIMAD9gKlgsngO6-NeZHyw3r8PI5lFaAz3xLdJDpmXnEIxVaZtbwHZf5InB8-vhTvHm-_N-yOevHBUFPr9fIqYb2mH6X3Cl4hb1z3bSU4nI-LJFYB3qVx_4qB/s640/Box+Shadow.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxWUsRDXzNPGBGq1ai2bgvIMAD9gKlgsngO6-NeZHyw3r8PI5lFaAz3xLdJDpmXnEIxVaZtbwHZf5InB8-vhTvHm-_N-yOevHBUFPr9fIqYb2mH6X3Cl4hb1z3bSU4nI-LJFYB3qVx_4qB/s72-c/Box+Shadow.png
Sticky TUTS | When Technology meets pleasure
https://stickytuts.blogspot.com/2013/07/how-to-make-box-shadow-without-images.html
https://stickytuts.blogspot.com/
http://stickytuts.blogspot.com/
http://stickytuts.blogspot.com/2013/07/how-to-make-box-shadow-without-images.html
true
1514106023108819307
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago