Center header image and make it clickable

Permalink
I am trying to center my header image and make it clickable.

here is the code I am trying to use
in header.php
<header>
        <div id="header-area">
        <a href="http://www.carolinestreetptso.org"><img src="<?php echo $this->getThemePath()?>/images/layout_top.png" alt="header image" align="middle" /></a>
        </div><!-- #header-area ends -->
    </header><!-- header ends -->


in my css
header {
        display: block; margin-left: auto; margin-right: auto;
}


The other issue I am having is when I use a non-clickable image, depending on the browser the image is not centered. Here is the code I was using for that

php
<header>
        <div id="header-area">
                <?php
                        $a = new Area('Header Top');
                        $a->display($c);
                        ?>
        </div><!-- #header-area ends -->
    </header><!-- header ends -->


header {
  background: url(images/layout_top.png) no-repeat top left;
        position: relative;
        padding-top:220px;
        margin-left:220px;
}


Right now I have the first set of code implemented.

the website is:http://www.carolinestreetptso.org...

globalnerds
 
webpresso replied on at Permalink Best Answer Reply
webpresso
Hi

First Isssu:
Css:
header {
    display: block;
    height: auto;
    margin:0 auto;
    width: 100%;
}
#header-area {
    margin: 0 auto;
    text-align: left;
    width: 60%;
}


Second Issu:
Not Testet:
header {
background-image: url(images/layout_top.png);
background-repeat: no-repeat;
background-position: top center;
background-size:contain;
width:100%;
height:172px;
}


Best,
Tino
globalnerds replied on at Permalink Reply
globalnerds
I used your first suggestion:
header {
    display: block;
    height: auto;
    margin:0 auto;
    width: 100%;
}
#header-area {
    margin: 0 auto;
    text-align: left;
    width: 60%;
}


I had to tweak the width in the header-area a bit, but it worked.

Can you take a look just to be sure? Thanks!!
webpresso replied on at Permalink Reply
webpresso
It's ok.
You can give your header-area every width (px,%,em) and it will be in the center of the header.