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?
<td width="99%" ><img src = "logo-top.gif" >
<table border="1" cellpadding="0" cellspacing="0" width="99%">
<tr><td><img src="logo-top.gif" width="100%" alt="logo"></td></tr>
Last edited by Fang; 10-25-2007 at 11:01 AM.
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)