treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] CSS Help: Img & Div

  • Hi,

    and here is css:

    .user_avatar {
        width: 75px;
        height: 75px;
        border: 1px solid #000000;
        overflow: hidden;
        margin: 2px 10px 0px 0px;
    }
    
    
    .user_avatar.img {
        width: 75px;
        height: auto;
        position: absolute
    }
    

    div is ok but ".user_avatar.img" not working, and img not resize to 75px, what's the problem? i also change the css to:

    user_avatar.img

    and

    user_avatar.img

    or

    user_avatar.img.avatar

    but neither working!

  • I think you should try

    
    .user_avatar img{
    width: 75px;
        height: auto;
        position: absolute;
    }
    

    the '.' symbol is for class names. Anoher thing - are you trying to position the img absolutely in relation to the div? Then you'll have to give a position:relative to the container div too.

    Here's a pen

    http://codepen.io/Krish1980/pen/hBbEa

  • yes, my problem was '.' symbol. Thanks for your help, it works, here: http://codepen.io/Pedram/pen/rEibv