WordPress.org

Support

Support » Requests and Feedback » How to center a img in div tag

How to center a img in div tag

  • I’m having some problems with my CSS codes.
    I need to center an image in my css code, if it is possible?
    Heres my code:

    #header {
    	position:absolute;
    	left:0px;
    	top:0px;
    	width:100%;
    	height:64px;
    	z-index:1;
    	background-image:url(images/logo.png);
    	background-repeat:no-repeat;
    	background-color:#fff;
    	text-align:center;
    }

    Please help!

Viewing 1 replies (of 1 total)
  • esmi

    @esmi

    Forum Moderator

    Try:

    #header {
    	position:absolute;
    	left:0;
    	top:0;
    	width:100%;
    	height:64px;
    	z-index:1;
    	background-image:url(images/logo.png);
    	background-repeat:no-repeat;
    	background-position:center center;
    	background-color:#fff;
    	text-align:center;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How to center a img in div tag’ is closed to new replies.
Skip to toolbar