text over image

Discussion in 'HTML & Website Design' started by itamarlevy, Feb 29, 2012.

  1. #1
    Hi, im building a simple html/css website and im trying to place text over an image using this code:

    <div id="container">
    <div><img src="about1.png" width="950" height="758"></div>
    <div style=" position:absolute; left: 800px; top: 10px;">
    <span style="font-weight: bold; color: #000;">Moooooo...</span>
    </div>


    Everything works fine but when I open the web page on a different screen (different size) text is losing its right place.

    Any thoughts?
     
    itamarlevy, Feb 29, 2012 IP
  2. Dove77

    Dove77 Member

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Not sure about your code above, but you could have the pic as a background in a table and then place the text in one of the table cells...
    Or to me (a graphic designer) it would be the quickest solution to add the text directly onto the image about1.png already from start... ;)
     
    Dove77, Feb 29, 2012 IP
  3. siberia77

    siberia77 Active Member

    Messages:
    293
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Dove77 is right, you are making work for yourself, why not do it the easier way:)
     
    siberia77, Feb 29, 2012 IP
  4. ValDeV

    ValDeV Member

    Messages:
    130
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    You could also use a z index and put the text ontop.
     
    ValDeV, Feb 29, 2012 IP