Welcome to WebmasterWorld Guest from 54.158.51.150

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Simple HTML question from a novice.

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

10+ Year Member



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)

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



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

10+ Year Member



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

WebmasterWorld Senior Member 10+ Year Member



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)

10+ Year Member



uk gimp

I wanted it not to flow! :)

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

10+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



ahhhhhhhhhhhh

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

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

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



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)

10+ Year Member



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)

10+ Year Member



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)

10+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month