Rounded Corners and Shadows for Images using CSS | KhmerueTeams Official

Rounded Corners and Shadows for Images using CSS

Here are some unique border styles that you can apply to blogger images by using the border-radius property and defining either all four corners simultaneously or applying the rounded border only to some of them. One of the advantages of CSS3 is that we can apply rounded borders without complicating things too much and one of the options would be to use these edges or borders to images in the blog posts, to which we can also add some hover effects such as shading and rounded borders accompanied by transitions. Below are a few examples of these borders and how the images behave when you hover over them.

If you want to use one of these styles, just copy the code below the image, then go to Template, click on the Edit HTML button and paste that code before ]]></b:skin> (CTRL + F to find it)

Style 1: Use the codes below:

.post-body img {

border:0;

padding:0;

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

}

.post-body img:hover {

box-shadow: 0px 0px 15px #000; /* Shadow */

border-radius: 50%; /* Rounded border */

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

cursor:pointer;

}

Style 2: Leaf style use the code below:



.post-body img {

border:0;

padding:0;

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

}

.post-body img:hover {

box-shadow: 0px 0px 15px #000; /* Shadow */

border-radius: 50%; /* Rounded border */

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

cursor:pointer;

}

Style 3: Square Style use the code below: 

.post-body img {

background:#FFF; /* background color around the image */

padding:15px; /* space between border and image */

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

}

.post-body img:hover {

box-shadow: 0px 0px 15px #000; /* Shadow */

border-radius: 0% 50%; /* Rounded border */

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

cursor:pointer;

}

Style 4: Use the code below:

.post-body img {

box-shadow: 0px 0px 15px #000; /* Shadow */

border-radius: 50%; /* Rounded border */

border:0;

padding:0;

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

}

.post-body img:hover {

box-shadow: 0; /* With this we remove the shadow (value 0) */

border-radius: 0; /* This removes the border roundness (value 0) */

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

cursor:pointer;

}

Style 5: Use the code below:



.post-body img {

border-radius: 45% / 20%; /* Rounded border */

box-shadow: 0px 0px 15px #000; /* Shadow */

padding:0;

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

}

.post-body img:hover {

border-radius: 0; /* This removes the roundness of border (value 0) */

-moz-transition: all 1s;

-webkit-transition: all 1s;

-o-transition: all 1s;

cursor:pointer;

}

So these effects will apply to all images uploaded to your Blogger posts. But if you want to apply them only on certain pictures then change .post-body img with .rounded  and .post-body img:hover with .rounded:hover

Then add the rounded class selector in the image's code:

<img class="rounded" src="Image URL"/>

These are just some examples, however, you can modify them anytime by adding or deleting more CSS styles, it depends on everybody's tastes or needs. But as you have seen, we can make the images look way more attractive and this has been done only with CSS ;)

Share on Google Plus

About KhmerueTeams Official

Welcome to KhmerueTeams Officials Blogger. I am Mr. Chhuye The Admin of this blogger. If you have quetion contact me : +855968555664 / +855976235033 or watch my video on

YOUTUBE HERE

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment