Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

making a div float over an image

  • 02-12-2006 12:50PM
    #1
    Registered Users, Registered Users 2 Posts: 872 ✭✭✭


    Hi,

    Im making a site that needs to be very search engine friendly.

    The header is basically an image with the logo over to the left of the image. The logo is just text with a background colour so i want to make this a separate object to the image so i can make the text a h1 tag which is meant to be great for search engines.

    The site is centered in the browser. If i make the logo a div how can it appear on top of the image and move if the browser is resized.

    I never really understood all the absolute relative position stuff.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,203 ✭✭✭Serbian


    One of the ideas behind semantic markup is that all decorative images should be background images. With that in mind, why not make the header image the background of the header div and then place the logo inside that div using padding / margin. It would look something like this:
    /* Stylesheet */
    
    #header {
       width: 750px;
       height: 50px;
       background: #fff url(/path/to/background.png) no-repeat top left;
    }
    
    #header h1 {
       margin: 10px;
       padding: 0;
       color: #333;
    }
    
    <!-- HTML -->
    <div id="header"><h1>Logo Text in Here</h1></div>
    


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    excellent idea Serbian, ill do exactly that.

    Thanks


Advertisement