Results 1 to 5 of 5
  1. #1

    css background image

    I have problem for the height of the background image. I have a 800px X 350px gradient background image, I used css to make the image as a background so i can create text above the background layer. when my text area (inside the table with the background color) is longer then 350px, the gradiented image will only shows of the height of the image. The background image should be same height of the text (table height). THe webpage i create not every page are the same height. If I make it heigth to 800px X 1000px this will make the shorter page background look weired and no gradient background for the shorter page. This make it not nice if i repeat the background. And also, why my css background-image is not work on firefox? My question is how can i to accomplish these two? any advise will be very appreciate.

    Here is the link to view what i am talking about of my problem.
    <style type="text/css">
    div#img {

    background-image:url(file:///C|/Documents and Settings/siew/Desktop/test/bg.jpg); background-repeat:no-repeat;

    <div id="img">
    <table width="600" bgcolor="#00FF00" align="center">
    <td width="637">Scientists Study Robot-Human Interactions

    <p>HATFIELD, England, Aug. 30 (UPI) -- British scientists are studying how people interact with robots to determine what future machines should look like and how they should behave.</p>

    blah blah blah


  2. #2
    Well if you include the image we could probably help (right now it's file:///C|/Documents and Settings/siew/Desktop/test/bg.jpg and there is no way to see it). Other than that you have some issues with your code - your table is first 600px and then the column is 637px - that's not good. Try defining your css as #img instead of div#img.
    Cheap web hosting
    Any CMS pre-installed
    Joomla Hosting

  3. #3
    Join Date
    May 2004
    Also, img is a pre-existing html tag! Really not a good idea to repurpose it as a div ID. Use a more descriptive (and non-reserved) word like "bk-gradient" instead.

  4. #4
    Join Date
    Jul 2002
    Tasmania, Australia
    Moved to Web Design and Content
    If you donít like the road youíre walking on, start paving a new one.

  5. #5
    First of all, thank you very much guys for reading my question. My question to "maiahost" will it different if I change div#img to #Img? You got the point, your way is right way of using css.

    My second question to you is about the image. I have a link that you can see the background image and so i didn't attach to it. Anyway, here is the link

    Third,you are saying the table layout is not good, how is that? That's the way it will be for the layout, 600px width and unknown height which is depends on how long the article will be.

    Question for a"non-e-mouse" what do you mean Moved to Web Design and Content???

    thanks again for your feedback.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts