Tuesday, July 5, 2011

How to add a Polaroids Picture Gallery to Blogger using CSS3 and HTML

Adding a Polaroid Picture Gallery to your Blogger is a fairly simple tutorial. With a few snippets of codes and pictures of your own, you can add your very own Polaroid Picture Gallery to Blogger using HTML and CSS3.

Before you begin the tutorial; make sure to back up your current existing template in case it doesn't turn out as expected. 

Okay, lets get started. Begin by logging into your Blogger dashboard > Design > Page Elements. Once your on the "Page Elements" page, select "Add a Gadget" to add an "HTML/JavaScript" gadget.  The next step is to copy and paste the following snippet code below into your configuration box.
<p>
<ul class="polaroids">
       
<li>
<a href="http://www.blogspotvision.com/search/label/tutorials?max-results=6" title="Tutorials">
<img src="https://lh4.googleusercontent.com/-cOzeQsLqyUw/Tgp68po7YPI/AAAAAAAAB38/YSiYIBTokxQ/s288/tutorials.jpg" alt="" />
</a>
</li>

<li>
<a href="http://www.blogspotvision.com/search/label/icons?max-results=6" title="Icons">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJhxjUXIBlfU2eu0s2InBYN_USLSYGLjqFuwscJxWh-jznyY3AYTorYsXNNi1WUQdTn5xIBeftM-6EC1UJzv11SQE65LbkDBm1NVDUblnRJe4nCxZbXjMgQcatKGVvnSdlDcBvJEB6Hmc/s288/icons.jpg" alt="" />
</a>
</li>
       
</ul>
</p>
<br class="clear" />
Note: You can exclude the <p> &</p> if you do not want your polaroids in a paragraph. Make sure you change the links and images to that of yours. To change the title located at the bottom of your polaroid picture, just change the "title" of your image (located in the link's HTML). If you want your title to be located on top; leave the image "title" blank, but add the title to the "alt" of your image's HTML. To add more polaroids, simply copy and paste another list; for example the snippet above shows two polaroid pictures.

The next step now is to style your polaroid picture gallery. To do this, simply add the following CSS snippet code to the opening of your head section.
<style type='text/css'>       
        ul.polaroids { width: 485px; margin: 0 0 18px -30px; }
        ul.polaroids li { display: inline; }
        ul.polaroids a { background: #fff; display: inline; float: left; margin: 0 0 27px 30px; width: auto; padding: 10px 10px 15px; text-align: center; font-family: &quot;Marker Felt&quot;, sans-serif; text-decoration: none; color: #333; font-size: 18px; -webkit-box-shadow: 0 3px 6px rgba(0,0,0,.25); -moz-box-shadow: 0 3px 6px rgba(0,0,0,.25); -webkit-transform: rotate(-2deg); -webkit-transition: -webkit-transform .15s linear; -moz-transform: rotate(-2deg); }
        ul.polaroids img { display: block; width: 190px; margin-bottom: 12px; }
        ul.polaroids a:after { content: attr(title); }
       
        ul.polaroids li:nth-child(even) a { -webkit-transform: rotate(2deg);  -moz-transform: rotate(2deg); }
        ul.polaroids li:nth-child(3n) a { -webkit-transform: none; position: relative; top: -5px;  -moz-transform: none; }
        ul.polaroids li:nth-child(5n) a { -webkit-transform: rotate(5deg); position: relative; right: 5px;  -moz-transform: rotate(5deg); }
        ul.polaroids li:nth-child(8n) a { position: relative; right: 5px; top: 8px; }
        ul.polaroids li:nth-child(11n) a { position: relative; left: -5px; top: 3px; }
       
        ul.polaroids li.messy a { margin-top: -375px; margin-left: 160px; -webkit-transform: rotate(-5deg); -moz-transform: rotate(-5deg); }
       
        ul.polaroids li a:hover { -webkit-transform: scale(1.25); -moz-transform: scale(1.25); -webkit-box-shadow: 0 3px 6px rgba(0,0,0,.5); -moz-box-shadow: 0 3px 6px rgba(0,0,0,.5); position: relative; z-index: 5; }
       
        code { background: rgba(0,0,0,.5); padding: 2px 3px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.75); -webkit-border-radius: 3px; -moz-border-radius: 3px; }
       
        ol.code { background: rgba(0,0,0,.75); margin-bottom: 18px; border: solid rgba(0,0,0,.75); border-width: 1px 1px 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; -webkit-box-shadow: 0 1px 1px rgba(255,255,255,.5); }
        ol.code li, ol.code li code { font-size: 14px !important; }
        ol.code code { background: none; }
</style>
Note: You can change the style of your polaroids with this CSS snippet code. If you need help stylizing your picture gallery, please don't hesitate to leave a comment and ask for help.

2 comments:

  1. nice, btw...this is for what?

    code { background: rgba(0,0,0,.5); padding: 2px 3px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.75); -webkit-border-radius: 3px; -moz-border-radius: 3px; }
    ol.code { background: rgba(0,0,0,.75); margin-bottom: 18px; border: solid rgba(0,0,0,.75); border-width: 1px 1px 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; -webkit-box-shadow: 0 1px 1px rgba(255,255,255,.5); }
    ol.code li, ol.code li code { font-size: 14px !important; }
    ol.code code { background: none; }

    cheers \m/

    ReplyDelete
  2. hmm.. i think i might've added extra coding there lol.. good catch my friend! ;]

    ReplyDelete