Tuesday, 1 April 2014

Beautiful CSS Image Slider For Blogger

Beautiful CSS Image Slider For Blogger

A very beautiful CSS powered image slider for blogger. If you use HD images in this slider, it looks amazing and very pretty. To see the next picture, you need to click the dots below the images and after clicking the dots, the next image appears with atransition effect which looks really nice. So, let's start the coding.

Follow the instructions below:

  • Login to blogger.
  • Navigate to Template > Edit HTML > Proceed > Expand Widget Templates.
  • Search for the line ]]></b:skin> and just above it, copy and paste the code given below:
/* slider www.pctricksguru.com*/
#slider1 {
    width: 640px;
    height: 320px;
    margin: 50px auto 0;
    position: relative;
    background: #fff;
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.2);
    -moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.2);
}

#slider1:before, #slider1:after {
    content: '';
    position: absolute;
    width: 60%;
    height: 20px;
    -webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    -ms-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    -o-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    -webkit-transform: rotate(-4deg) skew(-10deg);
    -moz-transform: rotate(-4deg) skew(-10deg);
    -o-transform: rotate(-4deg) skew(-10deg);
    -ms-transform: rotate(-4deg) skew(-10deg);
    transform: rotate(-4deg) skew(-10deg);
    left: 10px;
    bottom: 13px;
    z-index: -1;
}

#slider1:after {
    left: auto;
    right: 10px;
    -webkit-transform: rotate(4deg) skew(10deg);
    -moz-transform: rotate(4deg) skew(10deg);
    -o-transform: rotate(4deg) skew(10deg);
    -ms-transform: rotate(4deg) skew(10deg);
    transform: rotate(4deg) skew(10deg);
}

#slider1 ul {
    width: 140px;
    height: 40px;
    padding: 0 0 0 0;
    position: absolute;
    z-index: 10;
    list-style: none;
    left: 50%;
    margin-left: -70px;
    bottom: -60px;
}

#slider1 ul li:first-child {
    margin-left: 16px;
}

#slider1 ul li {
    float: left;
    margin-right: 12px;
    margin-top: 14px;
}

#slider1 ul li:last-child {
    margin-right: 0;
}

#slider1 ul li a {
    width: 12px;
    height: 12px;
    display: block;
    outline: none;
    border: none;
    position: relative;
    z-index: 2;
    background: #aaa;
    box-shadow: inset 0 1px 1px 0px rgba(0, 0, 0, 0.6), 0px 1px 1px 0px white;
    -moz-box-shadow: inset 0 1px 1px 0px rgba(0, 0, 0, 0.6), 0px 1px 1px 0px white;
    -webkit-box-shadow: inset 0 1px 1px 0px rgba(0, 0, 0, 0.6), 0px 1px 1px 0px white;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

#slider1 ul li a:hover {
    background: #888;
}

#slider1 img {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    -webkit-transform: rotateZ(-10deg);
    -moz-transform: rotateZ(-10deg);
    -ms-transform: rotateZ(-10deg);
    -o-transform: rotateZ(-10deg);
    transform: rotateZ(-10deg);
    -webkit-transition: all .5s ease;
    -moz-transition: all .5s ease;
    -ms-transition: all .5s ease;
    -o-transition: all .5s ease;
    transition: all .5s ease;
}

#slider1 img:target {
    opacity: 1;
    -webkit-transform: rotateZ(0);
    -moz-transform: rotateZ(0);
    -ms-transform: rotateZ(0);
    -o-transform: rotateZ(0);
    transform: rotateZ(0);
}

#slider1 img#five {
    opacity: 1;
    -webkit-transform: rotateZ(0);
    -moz-transform: rotateZ(0);
    -ms-transform: rotateZ(0);
    -o-transform: rotateZ(0);
    transform: rotateZ(0);}

#slider1 img:not(:target), #slider1 img:target ~ img#five  {
  opacity: 0;
    -webkit-transform: rotateZ(-10deg);
    -moz-transform: rotateZ(-10deg);
    -ms-transform: rotateZ(-10deg);
    -o-transform: rotateZ(-10deg);
    transform: rotateZ(-10deg);
}

#slider1 ul li a[href="#five"] {
 background: #777;
}

#one:target ~ ul li a[href="#one"],
#two:target ~ ul li a[href="#two"],
#three:target ~ ul li a[href="#three"],
#four:target ~ ul li a[href="#four"],
#five:target ~ ul li a[href="#five"] {
  background: #777;
}

#two:target ~ ul li a[href="#five"],
#three:target ~ ul li a[href="#five"],
#four:target ~ ul li a[href="#five"],
#one:target ~ ul li a[href="#five"] {
 background: #aaa;
}
  • Now, save the template.
  • Now, go to Layout and Add A New HTML/Javascript Gadget.
  • In the content box, copy and paste the following code:
<div id="slider1">
 <!-- Sildes -->
 <img id="one" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ZQsGxG9bc7vMlpg2Br4HXJR2QJlAAM67p3axuq1kJHVIfQ2EpthlJ4joPoLhgObf6ZSwiO95X4pdoIQw-n1PTpkRnikhYKZa4qKVCTTxO-CYL1HJ5gS4kIUnXRHEZLHxA4U9fma7120/s1600/pctricksguru_image1.jpg" />
 <img id="two" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjslkoR1HvJXZfl_xCsLizYyuLrDIjy2r6_oubDPeGoSSU6Kexhc7RwWRyPE-lUXfpWViAmYe1o-80glVIyGDoVdZDnKIKpyt9l7kO0q1tHq5KTORDanj4gXnyKfwI258dd7NajId5P24k/s1600/pctricksguru_image2.jpg" />
 <img id="three" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPlYF8UwGo-uVlnNPcnJFCav_HloJEW-0FsFR9BF_zTS1CCOo_hnm1Lp5cGuLVkD9kb1ELDwKem5bPmJfr__3I5SkWN-62MKfXfvCY1O6s467QYjoC-eoo0U9MneIc6i53-sFCAROn7Zc/s1600/pctricksguru_image3.jpg" />
 <img id="four" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicwSVt3wFuCUGRA7tMVpTyS5BxfB4LIPT9hYCl1vijeeA8-BUsNtu4pZpBDTtjhZK75UwrYNbgl0zIP0L6KzC_KG1AjDr_RNRFpEvuJRisunDxlowj5sAmceMCMjZn4Axu5vo7bXzO08Y/s1600/pctricksguru_image4.jpg" />
 <img id="five" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqToNd5v89ASXrSywkKKrJeBsRAqvtWzH06VBnLA_a173eeeQYm2UCjxPF3dJxG2jHDyfskxs1M9rtA-0yjd1eeCaZ-yE-XIiLGDr_ujHemmvGXu7ZzgQ_w3_ug8w96xIqxGB3m-USoc/s1600/pctricksguru_image5.jpg" />
 <!-- Links for the slides! -->
 <ul>
  <li>
   <a href="#one"></a>
  </li>
  <li>
   <a href="#two"></a>
  </li>
  <li>
   <a href="#three"></a>
  </li>
  <li>
   <a href="#four"></a>
  </li>
  <li>
   <a href="#five"></a>
  </li>
 </ul>
</div>
  • Save the widget and see your blog. You will be amazed. It looks very beautiful.
Note: Replace the green text with the desired target link.

0 comments:

Post a Comment


Tips Tricks And Tutorials

You can also receive Free Email Updates:

Widget by NBT

Tips Tricks And Tutorials

You can also receive Free Email Updates:

Widget by NBT

Tips Tricks And Tutorials

You can also receive Free Email Updates:

Widget by NBT