Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Html Width problems

Status
Not open for further replies.

kennyaidan

Programmer
Apr 9, 2003
54
IE
Hi Guys,
I'm new to HTML and i am only learning it for the past few weeks. I am trying to set up a web page which will be made up of frames. There will be a header frame, sidebar frame and main frame. I set the frameset up fine and the sidebar and main pages work well, however i am having problems with the header file. I want to include images in the header file however when i try to put in all the images I get a scroll bar at the bottom of the page because I have exceeded the width requirement for my screen.
I want the images to appear in the following order
Logo.gif|spacer.gif|Main_title.gif|Spacer.gif(width="100%"|crest.gif|

Here's is my basic header code
<html>
<head>
<TITLE>AIDAN's Web Page</TITLE>
</head>
<body bgcolor=#000000 leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=&quot;100%&quot;>

<TR WIDTH=&quot;100%&quot;>

<TD WIDTH=&quot;145&quot;>
<IMG SRC=&quot;logo.gif&quot; WIDTH=145 HEIGHT=89 ALT=&quot;&quot;></TD>

<TD WIDTH=&quot;120&quot;>
<IMG SRC=&quot;spacer.gif&quot; WIDTH=120 HEIGHT=89 ALT=&quot;&quot;></TD>

<TD WIDTH=&quot;286&quot;>
<IMG SRC=&quot;main_title.gif&quot; WIDTH=286 HEIGHT=89 border=&quot;0&quot;></TD>

<!-- I need this spacer to take the width slack, it needs to be able to adjust the header size to different screen sizes-->

<TD WIDTH=&quot;100%&quot;>
<IMG SRC=&quot;spacer.gif&quot; WIDTH=&quot;100%&quot; HEIGHT=89 ALT=&quot;&quot;></TD>

<TD WIDTH=&quot;66&quot;>
<IMG SRC=&quot;crest.gif&quot; WIDTH=66 HEIGHT=89 ALT=&quot;&quot;></TD>

</TR>
</TABLE>
</body>
</html>

The problem seems to be the spacer.gif when the width =&quot;100%&quot; tag. It has a set size and won't adjust correctly.
If anyone would have any tips greatly appreciated
thanks
aidan

 
Try doing away with the 100% spacer, and combine the two <td> cells into one with a &quot;right&quot; alignment, like this:


<td colspan=&quot;2&quot; align=&quot;right&quot;>
<IMG SRC=&quot;crest.gif&quot; WIDTH=66 HEIGHT=89 ALT=&quot;&quot;></td>

Or, if you don't need this exact number of <td> cells, just completely do away with the one cell and the 100% spacer and use this:


<td align=&quot;right&quot;>
<IMG SRC=&quot;crest.gif&quot; WIDTH=66 HEIGHT=89 ALT=&quot;&quot;></td>

Since you have your TABLE specified at 100% width, this should take the content of the last <td> cell and put it on the right side of the screen.

Hope this Helps!


 
do you really want to learn how to make websites? if the answer is yes then abandon frames and use tables, DIVS, SPANS, LAYERS, WIDGETS, HOODWINKS but no need for frames (95% of the time at least).

One of my first sites i made about a year and a half ago was framed...after that never again. IMO there are better ways to make a site work.

As for your spacer problem change the width to say 50px rather than a percentage. You can set the width to whatever you want, think of percentage as ever changing depending on screen size where as a fixed size will always be that no matter what resolution you are looking at.

Hope this helps...if it doesn't well you can pass it along till it hits someone it does... :/

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
thanks guys i have tried what u suggested and it seems to have done the trick
thanks
aidan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top