Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

circle overlay does not stretch 100%

circle overlay does not stretch 100%

Problem

I'm trying to dynamically populate circles with pictures that upon hover, will display an orange tint. However, I have a strange orange border to the picture. Any ideas on how to 'stretch' the picture to cover the orange color? Thank you in advance! Code below:

HTML code:

CSS code:

.circle {
    float: left;
    background: #d9d6d1;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    -moz-border-radius: 50%;
    -webkit-border-radius: 50%;
    -moz-transition: all 0.5s; 
    -webkit-transition: all 0.5s; 
    -ms-transition: all 0.5s; 
    -o-transition: all 0.5s; 
    transition: all 0.5s; 
    opacity:1;
    filter:alpha(opacity=100);
}

.circle:hover {
    opacity: 0.5;
    filter:alpha(opacity=50);
}

.overlay {
    float: left;
    background:#fd761f;
    margin: 5px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    -moz-border-radius: 50%;
    -webkit-border-radius: 50%;
}

jsfiddle: http://jsfiddle.net/hpPpD/

Problem courtesy of: stefanie

Solution

This works for me:

.overlay:hover {
    float: left;
    background:#fd761f;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    -moz-border-radius: 50%;
    -webkit-border-radius: 50%;
}

The only things I've changed are adding :hover to the .overlay class and remove the margin:5px

Note: The way a image gets rounded and resizes in CSS depends on its original size.

Solution courtesy of: Radu Tutunaru

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

circle overlay does not stretch 100%

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×