Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 7 of 7

This is a discussion on background image in table not lining up with other images in the Design and Development forum
First off, I'm not a web designer but have dabbled in it here and there. Use my VPS more as a learning tool. I am ...

  1. #1
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161

    background image in table not lining up with other images

    First off, I'm not a web designer but have dabbled in it here and there. Use my VPS more as a learning tool. I am starting some work on a site for a friend and am having a problem with background image in a table.

    The background image is a pixel or two (can't tell on screen) above the images that I'm placing in the <td> tag of the table. Below is the CSS and html code I have.

    CSS
    Code:
    body {
        margin-left: 7%;
        margin-right: 7%;
        margin-top: 0px;
    }
    
    table.header {
        width: 100%;
        background-image: url("images/ft_logo_05.gif");
        border-width: 0px;
        padding: 0px;
        border-spacing: 0px;
    }
    HTML CODE
    Code:
    <table class="header">
        <tr>
            <td>
                <img src="images/ft_logo_01.gif" />
            </td>
            <td>
                <img src="images/ft_logo_02.jpg" />
            </td>
            <td>
                <img src="images/ft_logo_04.gif" />
            </td>
        </tr>
        <tr>
            <td><img src="images/ft_logo_06.gif" /><td>
        </tr>
    </table>
    He is example of what I'm getting: http://dev.fasttrackrentals.com

    I've checked the background image I'm using and it's same height as my header which I sliced up using photoshop. Anyone have any ideas what I could be doing wrong?

  2. #2
    JPC Member
    Join Date
    Oct 2011
    Location
    South Africa
    Posts
    18
    Quote Originally Posted by randyriegel View Post
    First off, I'm not a web designer but have dabbled in it here and there. Use my VPS more as a learning tool. I am starting some work on a site for a friend and am having a problem with background image in a table.

    The background image is a pixel or two (can't tell on screen) above the images that I'm placing in the <td> tag of the table. Below is the CSS and html code I have.

    CSS
    Code:
    body {
        margin-left: 7%;
        margin-right: 7%;
        margin-top: 0px;
    }
    
    table.header {
        width: 100%;
        background-image: url("images/ft_logo_05.gif");
        border-width: 0px;
        padding: 0px;
        border-spacing: 0px;
    }
    HTML CODE
    Code:
    <table class="header">
        <tr>
            <td>
                <img src="images/ft_logo_01.gif" />
            </td>
            <td>
                <img src="images/ft_logo_02.jpg" />
            </td>
            <td>
                <img src="images/ft_logo_04.gif" />
            </td>
        </tr>
        <tr>
            <td><img src="images/ft_logo_06.gif" /><td>
        </tr>
    </table>
    He is example of what I'm getting: Fast Track Rentals

    I've checked the background image I'm using and it's same height as my header which I sliced up using photoshop. Anyone have any ideas what I could be doing wrong?
    ideally you should hv zipped everything up and made it available so we can help you - you havent made it all that easy with the info you provided.

  3. #3
    Loyal Client
    Join Date
    Jun 2011
    Posts
    51
    Quote Originally Posted by randyriegel View Post
    Code:
    table.header {
        width: 100%;
        background-image: url("images/ft_logo_05.gif");
        border-width: 0px;
        padding: 0px;
        border-spacing: 0px;
    }
    I've checked the background image I'm using and it's same height as my header which I sliced up using photoshop. Anyone have any ideas what I could be doing wrong?
    Have you set the margins, padding, border and border-spacing to 0px for the <tr> & <td> tags? Some browsers don't start out with 0px padding & 0px margin. We start every page's stylesheet with this just to be sure they're all starting on a level playing field:

    Code:
    * {
       margin: 0;
       padding: 0;
    }

  4. #4
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,384
    Quote Originally Posted by Main Street James View Post
    Have you set the margins, padding, border and border-spacing to 0px for the <tr> & <td> tags? Some browsers don't start out with 0px padding & 0px margin. We start every page's stylesheet with this just to be sure they're all starting on a level playing field:

    Code:
    * {
       margin: 0;
       padding: 0;
    }
    Watch using Master Resets, or rather if your going to us a master reset make sure you redefine the spaces for common tags like UL, P, BLOCKQUOTE, etc as the master reset screws them up badly.

    No CSS Reset - Snook.ca
    -------------------------
    the_ancient
    MP Technology Group

  5. #5
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,384
    Quote Originally Posted by randyriegel View Post
    First off, I'm not a web designer but have dabbled in it here and there. Use my VPS more as a learning tool. I am starting some work on a site for a friend and am having a problem with background image in a table.

    The background image is a pixel or two (can't tell on screen) above the images that I'm placing in the <td> tag of the table. Below is the CSS and html code I have.

    He is example of what I'm getting: Fast Track Rentals

    I've checked the background image I'm using and it's same height as my header which I sliced up using photoshop. Anyone have any ideas what I could be doing wrong?
    You must have corrected it because it looks fine in both FF and Chrome on my system

    If you just learning Design however I would like to point out that Tables should be used to display tabular data, Layout should be done with div's not tables
    -------------------------
    the_ancient
    MP Technology Group

  6. #6
    Loyal Client
    Join Date
    Jun 2011
    Posts
    51
    Quote Originally Posted by the_ancient View Post
    Watch using Master Resets, or rather if your going to us a master reset make sure you redefine the spaces for common tags like UL, P, BLOCKQUOTE, etc as the master reset screws them up badly.
    We define each and every tag we use in a page in the CSS without exception. We even have the server append supplemental CSS formatting based on platform/browser/version if necessary to maintain a consistent user experience across platforms, browsers & browser versions. It's a PITA but our designer is OCD enough that it is the lesser of two evils.

  7. #7
    JPC Dream Team JPC-Sabrina's Avatar
    Join Date
    Aug 2011
    Posts
    336
    Take a look at this thread posted by our CTO. It is a good HTML and CSS course that may be of some assistance. It is a basic course. Sometimes a quick refresh is helpful.

    Thread:
    30 Days to Learn HTML and CSS

    30 Day Free Course:
    30 Days to Learn HTML & CSS - Free Tuts+ Premium Course
    JPC-Sabrina / Public Relations
    sabrina@jaguarpc.com

    Sabrina/ Public Relations
    (email)

    Need a Manager?
    (pm) | (email) David, Customer Service Manager
    (pm) | (email) Masood, Chief Technical Officer
    (pm) | (email) Les, Chief Operations Officer

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
  •