Thursday, 14 March 2013

Beautiful CSS Image Slider For Blogger

Beautiful CSS Image Slider For Blogger
Hi friends, today I have 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 a transition 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="http://3.bp.blogspot.com/-U0hV_-3reI4/UUGmmhRlIiI/AAAAAAAAAOw/3beJOxaFnn8/s1600/pctricksguru_image1.jpg" />
 <img id="two" src="http://2.bp.blogspot.com/-2faS4xBA_is/UUGmmip9gbI/AAAAAAAAAO0/fOw1ziPrfKU/s1600/pctricksguru_image2.jpg" />
 <img id="three" src="http://1.bp.blogspot.com/-Zd3Bvz42m4o/UUGmn_AM8aI/AAAAAAAAAPA/M5uR-GT5sYE/s1600/pctricksguru_image3.jpg" />
 <img id="four" src="http://4.bp.blogspot.com/-6WK7-na_Zv0/UUGmotImVAI/AAAAAAAAAPI/km2SKmG-Ilg/s1600/pctricksguru_image4.jpg" />
 <img id="five" src="http://2.bp.blogspot.com/-kMY2i7KLJFQ/UUGmo01DpvI/AAAAAAAAAPM/20lXraf6ei8/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.
Share:

0 blogger:

Post a Comment

Custom Search Box

Subscribe Our Newsletter

Advertise With Us

Blog Archive