www.webdeveloper.com
Results 1 to 3 of 3

Thread: Image and screen resolution

  1. #1
    Join Date
    Oct 2007
    Posts
    1

    Image and screen resolution

    I am having an issue with a banner that is going across the page. If the user is using the screen resolution of 1024 by 768, the user has to scroll from the bottom of the page to see the complete image. The image's properties are 1280 by 60. This has been used before with an older banner with no issues. Is there something wrong with my code?

    <tr>
    <td width="99%" ><img src = "logo-top.gif" >
    </td>
    </tr>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <table border="1" cellpadding="0" cellspacing="0" width="99%">
    <tr><td><img src="logo-top.gif" width="100%" alt="logo"></td></tr>
    </table>
    http://www.hotdesign.com/seybold/
    Last edited by Fang; 10-25-2007 at 10:01 AM.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    May 2005
    Location
    Northern Indiana
    Posts
    597
    Sorry for chiming in late, but I thought I might add a little more information.

    First off, as Fang so eloquently put it, the primary problem is that you are using a table for layout, which is very very bad. You would be much better off putting a div in your page, specifying the height and width and setting your image as the background.

    The problem with your code (aside from the fact that it is a table) is that your cell contains the image. As a result, the table is going to expand to accommodate that image, regardless of the width you specified. If, instead of putting an image inside of the cell, you made the image the cell's background, I think you would find that the browser respects your width specification, and the scrolling is eliminated.

    However, that information is provided purely for educational purposes- please do not implement it. Use a "correct" approach instead, like the div I mentioned above.

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