Text over image problem

Discussion in 'HTML' started by Graham S, Oct 18, 2012.

  1. Graham S

    Graham S Guest

    I am displaying a small image in a table data cell of an HTML table and I
    want to display between 1 and 3 letters over the center of this image. Any
    clues on the CSS needed to achieve this?
     
    Graham S, Oct 18, 2012
    #1
    1. Advertising

  2. 2012-10-18 9:52, Graham S wrote:

    > I am displaying a small image in a table data cell of an HTML table and I
    > want to display between 1 and 3 letters over the center of this image. Any
    > clues on the CSS needed to achieve this?


    Wrap the text in a <span> element and both it and the <img> element in a
    <div> element. Set position: relative on the <div> element and then
    position the <img> and <span> absolutely inside it. It is simplest,
    though not most flexible, to set the width and height of <div> the same
    as those of the image and set display: block on <img> (to avoid extra
    spacing).

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Oct 18, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Varangian

    Check Image is over another Image

    Varangian, Mar 31, 2006, in forum: ASP .Net
    Replies:
    9
    Views:
    377
    Varangian
    Apr 5, 2006
  2. Phillip Roncoroni
    Replies:
    6
    Views:
    6,207
  3. Trond Valen
    Replies:
    5
    Views:
    400
    Niklas Norrthon
    Dec 7, 2005
  4. Replies:
    0
    Views:
    88
  5. Replies:
    5
    Views:
    143
Loading...

Share This Page