Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    9
    Member #
    11017
    Hi,
    This may seem a daft question but I'm trying to design a page using a table with two rows. In the bottom cell I want to use a jpg as a background and then have text that i can type over the top of the background. However I have found so far that the text just appears on the next line down from the image or the line above the image. Is what I'm asking possible and if so what is the relevant HTML or CSS? I've trawled the net for an answer but you know what a mass of cyberturd google throws at you.

  2.  

  3. #2
    Senior Member
    Join Date
    May 2005
    Location
    Essex, United Kingdom
    Posts
    200
    Member #
    10131
    This code should work:
    Code:
    HTML:
    <td class="bg">Your text here</td>
     
    CSS:
    .bg {background-image:url('image.gif');}

  4. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    9
    Member #
    11017
    Thankyou for your help, however, this hasn't solved my problem, it seems odd because I tried exactly the same thing that you suggested. I even tried putting the css code in a externally linked css file as css has a tendancy to be iffy. This didn't work either.

    I've made a stripped down version of the page with borders enabled so you can see the problem. Ignore the logo in the top cell as I don't need to have text over it (and dont mock the logo... I didn't design it...god knows why the band want to keep it). I need the background in the bottom cell

    Page can be found here: http://helios.hud.ac.uk/c0359743/Evenhand2/index.htm

    The background I want to use can be found here: http://helios.hud.ac.uk/c0359743/Evenhand2/back.jpg

    Perhaps someone can spot something that I'm missing. I'm also using Dreamweaver MX 2004 (which I'm just getting to grips with).

  5. #4
    Senior Member
    Join Date
    May 2005
    Location
    Essex, United Kingdom
    Posts
    200
    Member #
    10131
    Is the problem that the cell is not stretching so that you can see the whole background because it won't do, you will have to specify the height and width in the CSS. Also in the CSS the line
    Code:
    bg {background-image:url('back.jpg');}
    should have a . before bg e.g.
    Code:
    .bg {background-image:url('back.jpg');}
    this tells the browser that it is a class otherwise it could have been a class or an id, and therefore wouldn't have worked properly.

    Hope this helps


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:37 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com