Results 1 to 4 of 4

Thread: Watermark Script

  1. #1
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Watermark Script

    1) Script Title: Watermark Background Image Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex3/fixback.htm

    3) Describe problem:

    I changed the script to a css:
    Code:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <style type="text/css">
    #bgtable {
    background:url('../images/header.jpg') white center no-repeat fixed;
    }
    </style>
    </head>
    I need it to work inside a table that I have:
    Code:
    <body bgcolor="#FFFFFF">
    <div align="center">
    <table id = "bgtable" border="0" cellspacing="0" width="700" bgcolor="#FFFFFF">
    <tr>
    <td align=center colspan="2" width="100%"><p>&nbsp;<br>&nbsp; </p></td>
    </tr>
    ...much more table code...
    </table>
    </div>
    </body>
    </html>
    I get the header.jpg image in the table, but it doesn't float like in the example on the watermark script page. The image I have is stationary in the exact center of the table and as it is a "tall" table I need to scroll to see more of the table, but the header.jpg is fixed in the center and moves up and down with the scroll.

    How can I make the image float like in the watermark script example?

    Thanks!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    For fixed backgrounds to have the dramatic 'always in view' effect that they can have, they must be attached as the background of the element that is being scrolled. In this case, that is most likely the body.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks.

    The reason I attached it to the "table element" was because if I attached it to the body, then the table would "cover" it over and it would not be viewable behind the table.

    Got any idea how to make the image viewable "thru" the table if it is attached to the body?

    Or is having the image viewable thru the table a non-existant possibility?

    Thanks.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    The background image on a page will be viewable through any element on the page that doesn't have its own 'background' (image or color) and that isn't itself over another intervening element that has one of these.

    There are several ways that an element can acquire 'background', more so with tables. The one thing that is giving your table 'background' that I can see from your code in your first post is:

    Code:
    <table id = "bgtable" border="0" cellspacing="0" width="700" bgcolor="#FFFFFF">
    There could be others not shown in that, probably not. If you cannot figure out why your table has 'background', I would need to see your full code, preferably by having a link to your page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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