www.webdeveloper.com
Results 1 to 6 of 6

Thread: Placement of an image inside a table in CSS

  1. #1
    design is offline Supreme Master of the Web
    Join Date
    Oct 2003
    Posts
    188

    None

    NONE
    Last edited by design; 07-25-2005 at 12:36 AM.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,145
    You might be able to do something like this:
    Code:
    body {
    background: url(deilogo.gif) 10 10 no-repeat #ffffcc;
    color : #000000; 
    font-family : "times new roman", serif; 
    }
    Play around with the "10 10" values to get the right posisition ("0 0" is top left corner of body).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    design is offline Supreme Master of the Web
    Join Date
    Oct 2003
    Posts
    188

    none

    NONE
    Last edited by design; 07-25-2005 at 12:35 AM.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,145
    Thought of a better way. In your stylesheet, keep the body definition as you had it originally. Add the following style element:
    Code:
    td.logo {
      background: url(deilogo.gif) 0 0 no-repeat #ffffcc;
      height: 75px;
      width: 80px;
      padding: 0;
    }
    In your HTML, change the TD that currently has the image to this:
    Code:
    <td class="logo"></td>
    Voila!
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    design is offline Supreme Master of the Web
    Join Date
    Oct 2003
    Posts
    188

    none

    NONE
    Last edited by design; 07-25-2005 at 12:37 AM.

  6. #6
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,145

    Re: Placement of an image inside a table in CSS

    Originally posted by design
    When I do a print preview it does not show the image. How can I get around this?
    Hmmm..., the default setting for most browsers is to not print background images. The best workaround, probably, is to leave it as an IMG object in your table the way you originally had it.

    This is where using "server-side includes" (SSI) could help you. You could put the whole top navigation table into a separate file, then just include it into each of the site's pages with one include command. I do this on my site by using PHP server-side scripting. You can get the same general effect by using an HTML include...
    Code:
    <!--#include file="header.html"-->
    ...at the point in each file where you want that HTML to be included.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles