WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Linking Header to Homepage (6 posts)

  1. hmnikatz
    Member
    Posted 7 years ago #

    Hi, I am trying to make it so when people click on my header image, they go back to the main page....so if they leave a comment, instead of having to re type in the page address, they can click on the header and go back to the main page... I am a complete beginner, but I am getting a long ok....I know minimal HTML code, so if you are going to help, be as descriptive as possible. Here is what I think is my header code...

    <style type="text/css" media="screen">
    #headerimg { margin: 0; margin-top: 0px; height: 200px; width: 800px; }

    #headerimg { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/header.jpg') no-repeat top;}
    #footer { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/footer.jpg') no-repeat top;}

    </style>

    I want that if people click on header.jpg, they are brought back to http://www.sternshowclips.com

    Could someone show me what the new code would look like...

    Thanks! :)

  2. hmnikatz
    Member
    Posted 7 years ago #

    I keep trying to do it and the header image is dissapearing, I cant figure out where to put the a href code. Im not even sure if thats the right code to use.

  3. hmnikatz
    Member
    Posted 7 years ago #

    If i do it like this..

    A href = "www.sternshowclips.com"><style type="text/css" media="screen">
    #headerimg { margin: 0; margin-top: 0px; height: 200px; width: 800px; }

    #headerimg { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/header.jpg') no-repeat top;}
    #footer { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/footer.jpg') no-repeat top;}
    </a
    </style>

    Then the whole page is linked to the main page...i just want the header pic...someone has to know...please help.

  4. hmnikatz
    Member
    Posted 7 years ago #

    bump

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    You're changing the wrong thing. That's just a style, you cannot link a style.

    Look lower on your page, where the header is actually displayed. It'll be something like this:

    <div id="header">
    	<div id="headerimg">
    		<h1><a href="http://www.sternshowclips.com/"></a></h1>
    		<div class="description"></div>
    	</div>
    </div>

    Notice how you have nothing in that Anchor tag? That's why you have no main link, since anchors are inline and such.

    One trick way to do this is to make the anchor force to block mode and expand it to 100% of the available space. You'd need to add this code to your style that you've been futzing with:

    div#headerimg a {
    width:100%;
    height:100%;
    display:block;
    }

    This should work. I think. You may need to add an &nbsp; into the anchor. Not sure.

  6. hmnikatz
    Member
    Posted 7 years ago #

    Otto, Sir, you are a genious, thanks for all of your help.

    I am sure you will see more help threads from me and I thank you in advance for anymore help u give me.

Topic Closed

This topic has been closed to new replies.

About this Topic