Saturday, October 12, 2013

How to Add a Vintage Style to Images In Blogger using CSS

To get that vintage Instagram effect for your pictures you don't have to use a program, now you can use CSS and get a similar result! We will apply a shadow inside the image, add a border, put a color in it, and on top of our image, add another semitransparent image with a grunge style that will give a vintage touch.

See an example below: move the mouse pointer onto the image and it changes back to normal - notice that borders remain the same.

vintage images blogger

Obviously there will be images that will fit better these effects than others, but regardless of that we do, there should be made a few observations:

- this effect is made with CSS and it will not recognize some browsers, especially Internet Explorer. So this effect might not work on older versions of IE.
- The images are not centered, you will have to align them to the left (default) or to the right.

Now let's add the CSS code for applying this vintage Instagram effect on our images in our template.

Adding a Vintage Effect to Blogger Images

Step 1. From your Blogger dashboard > go to Template > Edit HTML



Step 2. Click anywhere inside the code area and press the CTRL + F keys to open Blogger' search box

Step 3. Type or paste the following tag inside the search box:
</head>
Step 4. Just above it, add the following CSS style:
<style>
.vintage img {
padding:0;
float:left;
}
.vintage {
border:10px solid #000;
position: relative;
float: left; /* Change to right if you want the images to be aligned to the right */
margin-right: 20px;
margin-bottom: 20px;
}
.vintage:before {
content: "";
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(255,102,0, 0.6); /* sepia */
background-image:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6cjp22gH5iE8YSevAlrGewMnK3SqQLgz_j2L9zgLe0Ohu1ejLgMoM85Gr92yspiBVBKf9OTFtr0p8qypNF-8Kh4Ickxm428K3KlVWLycE8kuAGAeFDhXf3rcjBfEyvyGNRnVICepyRGs/s0/grunge.png);
background-size: cover;
box-shadow: inset 0 0 50px #000, inset 0 0 50px #000, inset 0 0 50px #000;
-moz-transition: all 1s;
-webkit-transition: all 1s;
-o-transition: all 1s;
transition: all .1s;
}
.vintage:hover:before {
background: none;
box-shadow:none;
-moz-transition: all 1s;
-webkit-transition: all 1s;
-o-transition: all 1s;
transition: all .1s;
}
</style>
Note: The line in bold that corresponds to the color of the image, can be changed to any other color; here are some examples of traditional vintage:
background-color: rgba(0,0,255, 0.5); /* blue */
background-color: rgba(0,255,0, 0.5); /* green */
background-color: rgba(0,255,255, 0.5); /* cyan */
background-color: rgba(255,0,0, 0.5); /* red */
background-color: rgba(255,0,240, 0.5); /* violet */
If you want the image to not change to its original state on mouse hover, then remove the last code:
.vintage:hover:before {
background: none;
box-shadow:none;
-moz-transition: all 1s;
-webkit-transition: all 1s;
-o-transition: all 1s;
transition: all .1s;
}
Step 5. After you've made your changes, click on Save Template

Step 6. Finally, add the following HTML code inside the HTML part of your posts each time you want to apply the vintage effect to an image:
<div class="vintage">
<img border="0" src="URL of the image" /></div>
<div style="clear: both;"/>
Replace the text in blue with the url of your picture.

And that's it, with this little experiment you can have your vintage-style images using CSS only.

Saturday, October 5, 2013

How to Add a Widget Below First Post in Blogger

This tutorial will show you how to make a gadget/widget to appear just below the first Blogger post.

First, you must understand that the usual gadgets provided by Blogger can be added only where the design section allows this. Yet, we can show any element, for example, an AdSense ad, an image, a flash file or a video etc...

So, what we will do in this tutorial is to display an element under the first post, this means that it will not be visible below the other posts. This is great when you use any automatic summary, although it is not a requirement.

widget below post
This is easy to do and we will use the isFirstPost conditional tag for that element to show it under the first post published on our blog.

Adding A Gadget or Widget Below First Post in Blogger


Step 1. From your Blogger dashboard, go to Template and click on the Edit HTML button:


Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the Blogger search box

blogger search, blogger tutorials

Step 3. Type or paste this line below inside the search box and hit Enter to find it:
<b:include data='post' name='post'/> 
Step 4. Just below it add this code:
<b:if cond='data:post.isFirstPost'>
<div align="center" style="margin:10px auto;">
Here goes the code of the element you want to show
</div>
</b:if>
Note:

- The bolded text indicates to where you should paste the code of the element (eg. AdSense ad, a widget). 

- In red are the top margins (margin-top) and the bottom margins (margin-bottom), this is in case you want the element to move towards or away from the entries, also you can add any style like a background color, border etc..
Step 5. Preview to make sure everything is ok, then Save your Template by clicking on the Save template button. That's it!