WordPress.org

Ready to get started?Download WordPress

Forums

Centering logo? (3 posts)

  1. webDressing
    Member
    Posted 6 years ago #

    We're using WP 2.3.1. We are trying to center the logo in our header, something that usually is very easy, but this one is giving us grief. Here is our code from the header file:

    <div id="header">
    	<div id="logo">
    		<a href="http://www.url.com"><img src="http://www.url.com/wp-content/themes/stylin/images/logo_image.png" width="477" height="113" border="0" alt=""></a>
    		<?php if (is_home()) { ?>
    		<h1><?php bloginfo('description'); ?></h1>
    		<?php } else { ?>
    		<p id="tagline"><?php bloginfo('description'); ?></p>
    		<?php } ?>
    	</div>
    </div>

    Here is the CSS for those sections:

    /*---:[ #header styles ]:---*/
        #logo { width: 72.8em; margin: 0px 100px; }
    
    	#logo a { font: normal 5.0em "Verdana", "Trebuchet MS", sans-serif; color: #fff; }
    
    	#logo h1, #logo #tagline { display: none; font: normal 1.6em Verdana, "Helvetica Neue", Helvetica, Arial, sans-serif; }
    
    /*---:[ core layout elements ]:---*/
    
    #header { background: #000; border-bottom: 0.8em solid #a90000; color: #fff; }

    Do we need to turn the logo into a background image? The logo shows up but is currently left aligned. We have tried to center the CSS for both 'header' and 'logo' but it's not centering. Could something be overriding the CSS in this section?

  2. jeremyduffy
    Member
    Posted 6 years ago #

    Try this

    margin-left:auto; margin-right:auto;
    Set top and bottom margins appropriately.

  3. webDressing
    Member
    Posted 6 years ago #

    Nope, that didn't work, but thanks for trying.

Topic Closed

This topic has been closed to new replies.

About this Topic