WordPress.org

Ready to get started?Download WordPress

Forums

How to center a img in div tag (2 posts)

  1. superstara
    Member
    Posted 5 years ago #

    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!

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    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;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags