Welcome to WebmasterWorld Guest from 54.157.7.205

Forum Moderators: mack

Message Too Old, No Replies

Simple HTML question from a novice.

     
12:15 pm on Nov 13, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Aug 12, 2002
posts:262
votes: 0


When a user narrows the size of the viewing window, HTML text changes so it can be read without having to scroll from side to side. How can I stop this from happening?
12:18 pm on Nov 13, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


Use a table.
<table width="640">
Don't use percentages. Use absolute values.
12:28 pm on Nov 13, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Aug 12, 2002
posts:262
votes: 0


yes of course - half asleep this morning :)
1:53 pm on Nov 13, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 6, 2001
posts:2213
votes: 0


Why will % not work?

If you make the table a % of the window would that not cause the text to flow and not scroll.

Am I missing something?

1:55 pm on Nov 13, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Aug 12, 2002
posts:262
votes: 0


uk gimp

I wanted it not to flow! :)

1:57 pm on Nov 13, 2002 (gmt 0)

New User

10+ Year Member

joined:Oct 4, 2002
posts:18
votes: 0


By making the table a set pixel size you are telling it that no matter how large or small the window is made, the table will remain that set pixel size.

By making a table a percentage, the table will move to that set percentage based on the size that the window is made.

Does that help?

2:00 pm on Nov 13, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 6, 2001
posts:2213
votes: 0


ahhhhhhhhhhhh

and now it bocomes clear that I may well be a muppet :)

2:01 pm on Nov 13, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


You can also use a div based layout and give the div an absolute width in pixels.

A related method (usable some day in the near future) is the min-width: rule for an element, set with CSS. Browser support is spotty today, but eventually it *should* ensure that small windows don't completely collapse a layout.

Coupled with max-width: you can declare a liquid layout that doesn't get too wide or too narrow.

2:07 pm on Nov 13, 2002 (gmt 0)

Full Member

10+ Year Member

joined:Aug 12, 2002
posts:262
votes: 0


Tedster

Now thats the solution I really need. I set the text using css and z-order positioning, when the window chaged size to much it became a complete mess but some fexability would be great.

2:31 pm on Nov 14, 2002 (gmt 0)

New User

10+ Year Member

joined:Nov 14, 2002
posts:2
votes: 0


It is also possible to create a transparent 1 pixel gif. Then place the gif in the table and give it size variables of width=640 and height=1 this will let you use percentages in the table but never allow the table to shrink smaller then 640. Simple cross platform fix. Also the same gif can be used over and over to give this effect where ever it is required.
7:35 pm on Nov 18, 2002 (gmt 0)

New User

10+ Year Member

joined:Nov 17, 2002
posts:25
votes: 0


Perhaps the easiest way is to use a table.

Don't worry about setting the width parameter, just put the parameter 'nowrap' in the TD section.

Example code portion:
<td align="right" nowrap valign="middle">

In IE, Opera and Pheonix/Mozilla that allows the window to be resized only up to the point where the TD's contents would be wrapped. At which time the horizontal scrollbar appears instead.