How to attach a position attribute?

Discussion in 'CSS' started by MattUK, Jun 8, 2007.

  1. #1
    I have a header file that I'm trying to edit. Being a complete novice as CSS I'm having a few problems!

    The code was like this,

    <div id="bgcontain">
    <!-- header START -->
    
    <div class="HeaderBG">
     <div class="Header">
    <div style="position:absolute; left:35px;<a> href="http://www.link.com"><img src="http://www.imageurl.com"</a>
    </div>
      </div>
    
    Code (markup):
    However while the positioning works fine, the link fails to work. Remove the div style <div style="position:absolute; left:35px; and it works fine. What am I doing wrong?
     
    MattUK, Jun 8, 2007 IP
  2. MattUK

    MattUK Notable Member

    Messages:
    6,950
    Likes Received:
    377
    Best Answers:
    0
    Trophy Points:
    275
    #2
    I added that in and the image moved out of position and the link shows as a text link and not an image link.

    The code above seems to work fine to allign the image correctly, but the link doesn't work, though I'm sure the syntax isn't correct as it was all trial and error!
     
    MattUK, Jun 8, 2007 IP
  3. MattUK

    MattUK Notable Member

    Messages:
    6,950
    Likes Received:
    377
    Best Answers:
    0
    Trophy Points:
    275
    #3
    I managed to fix it :) I dropped the position attribute into the stylesheet rather than the page code which seemed to work fine.

    This teach myself CSS week seems to be paying dividends if not a lot of head scratching and hair loss!
     
    MattUK, Jun 8, 2007 IP