Forum Moderators: open

Message Too Old, No Replies

Why Isn't Text Properly 'wrapped' In Ie?

         

Ribtin

1:51 am on Aug 1, 2004 (gmt 0)

10+ Year Member



On a site I'm trying to build, when you click to some of the pages the text is suddenly made a little too wide and I get a vertical (side-to-side) scrollbar? IT SUCKS!

It's so strange, because I've found it's because of the horizontal scrollbar, that I get the vertical one. So that if delete most of the links so that the page doesn't need any horizontal scrollbar anymore, then the vertical dissapears as well! =( What the heck is wrong?

When I load it up in Opera it displays perfectly though!

Please help!

<Sorry, no personal URLs or site reviews. See TOS [webmasterworld.com]>

[edited by: tedster at 2:26 am (utc) on Aug. 1, 2004]

tedster

3:09 am on Aug 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vertical (side-to-side) scrollbar

First let's sort out some terminology, so we don't get all tangled up: side-to-side is horizontal.

IE has a known bug that adds unneeded side scrolling in some situations. Often it happens with a combination of frames and 100% width tables, but there are other situations.

Are you using a frames based layout?

Ribtin

5:37 am on Aug 1, 2004 (gmt 0)

10+ Year Member



Yes, I am using frames.

Is there a way to work around this bug?

tedster

6:47 am on Aug 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...it's because of the horizontal scrollbar, that I get the vertical one

Your description there sounds exactly like this report from O'Reilly:
[oreillynet.com...]

Unfortunately their work-around is horrendously complex.

Do your pages that get an unwanted horizontal scrollbar have any elements where you have a width rule? Especially look for widths of "100%" which is often the bugaboo. And if you have no width rules, 100% is the default for a <p> tag, so be suspicious of <p> tags.

Many people report that going to a "width:98%" rule for their paragraphs fixes the issue without all the complication you see on the O'Reilly page.

Finally (and I have not yet tested this on your particular IE bug) check out DrDoc's thread in our CSS Forum: Taking On IE Bugs [webmasterworld.com]. He's got quite a breakthrough there, and it simplifies lots of bug handling.

Ribtin

2:59 pm on Aug 1, 2004 (gmt 0)

10+ Year Member



tnx for all the help, but I still did not manage to fix it with your suggestions. =(

tedster

7:55 pm on Aug 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just as an experiment, try a CSS rule like p {width:90%;} and see if the scrollbar vanishes. If it does, that will at least show if this is the bug O'Reilly describes.

Ribtin

2:55 am on Aug 2, 2004 (gmt 0)

10+ Year Member



Where exactly do I put this? In the <head>?

I'm a noob...

tedster

4:25 am on Aug 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you can place stylesheets three different ways, and one of them would be in the head like this:

<style type="text/css">
p {width:90%;}
</style>

Be sure to check out our CSS Crash Course [webmasterworld.com]

Ribtin

4:35 am on Aug 2, 2004 (gmt 0)

10+ Year Member



I eventually found the original error!

Just delete these first line in all of your pages:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

It's totally unnecessary and causing a bottom bar in your pages. It's enough that your pages begin with <html> tag ;)

hehe.. it only gave room for another problem though:
I have an image positioned in the bottom right corner. I did this with this code:

<img STYLE="position:absolute; bottom:0px; right:0px" src="images/corner.jpg" name="corner" alt="Corner" width="154" height="226" align="bottom" >

At my 1200x1000 resolution, it displays correctly, but if I set it to 800x600 for example, the image is displayed on the bottom of the shown page, so that if I scroll down, it's suddenly in the middle. hmmm...

tedster

4:50 am on Aug 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure whose advice you are taking there, but calling a DTD "totally unneccesary" is a major stretch to put it mildly. And a Document Type Declaration is not an error, not at all. NOT having a DTD is an error.

If you're willing to write "street code", aka "tag soup" - and that's what you're heading for here - then this forum will not be a good place for advice because you are not applying any standards. There's a big difference between just making something look OK on your equipment and writing standard HTML that really works for most of your visitors, including search engine spiders.

The first rule for fixing any problem is validate your HTML with the W3C: [validator.w3.org...]

If you don't have a DTD, then their validator won't work -- you have to tell it what version of HTML you are writing.

Sorry to beat you up on this, but because you are a self-admitted noob, I'm concerned. I'd hate to see you spin off down the road that this advice is pushing you toward. The road back will be even bumpier.

Ribtin

2:23 pm on Aug 2, 2004 (gmt 0)

10+ Year Member



hmm...I see. But it DID fix the error! =)

tedster

7:28 pm on Aug 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Eliminating the DTD puts the browser into Quirks Mode - you can learn more about that here:

[webmasterworld.com...]

StupidScript

10:32 pm on Aug 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Regarding the placement of your image (bottom:0px right:0px):

Where exactly the "bottom" and "right" edges of the display are are definitely not assumable by the browser. In IE, the page needs to load before those attributes can be defined, and Netscape can only tell you the size of the browser window before the page loads...not the "bottom" or "right" of the document.

While you will use style instructions to position the image, you will need to write (or paste) a bit of script before it will work consistently. Check out the Javascript forum for help with this.