Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to center an image vertically & horizontally inside a bigger div?

danielm77danielm77 USAPosts: 72Member

I need to center an image both vertically & horizontally inside a bigger div. How can I achieve this using CSS?

Comments

  • DavidMDavidM USAPosts: 342Member
    #yourImageContainer
    {
        background:url(some_image.jpg) no-repeat center center;
        height:300px;
        width:100px;
    }
    
Sign In or Register to comment.