another CSS positioning question....

L

Leslie

re:
http://www.bessiebee.com/test/soc_studies_standards_STYLESHEET_TEST.HTML

This is a work in progress in my efforts to implement CSS. I know
there are things I need to eliminate, like the spacer.gif, but my
question, this time, is:

This page validates as both HTML 4.01 Transitional and CSS. However,
it displays differently in different browsers. I've checked it with
IE, Opera and Mozilla.

In both Opera and Mozilla the <div id="container2"> displays right
where I want it; at the top of the page and 5 px to the right of the
graphic. In IE, however, the gap between the graphic and div is much
wider AND I'm getting a horizontal scroll bar because the text doesn't
wrap.

Can someone please tell me what I'm doing wrong?

Thank you!!

Leslie
 
E

Eric Bohlman

In both Opera and Mozilla the <div id="container2"> displays right
where I want it; at the top of the page and 5 px to the right of the
graphic. In IE, however, the gap between the graphic and div is much
wider AND I'm getting a horizontal scroll bar because the text doesn't
wrap.

Can someone please tell me what I'm doing wrong?

Trying to specify the horizontal position of an absolutely positioned
element by using a margin rather than a position. Change "margin-top" to
simply "top."
 
L

Leslie

Trying to specify the horizontal position of an absolutely positioned
element by using a margin rather than a position. Change "margin-top" to
simply "top."

But, "margin-top" is used in "#container1" and I don't use that
anywhere on the web page. Having an unused style in the stylesheet
won't affect the web page, will it? And, would that explain why I've
got a horizontal scroll bar in IE but not Opera or Mozilla?

Leslie
 
E

Eric Bohlman

But, "margin-top" is used in "#container1" and I don't use that
anywhere on the web page. Having an unused style in the stylesheet
won't affect the web page, will it? And, would that explain why I've
got a horizontal scroll bar in IE but not Opera or Mozilla?

My fault. I meant to write "margin-left" and "left."

If you specify only one dimension when doing positioning, the other one
defaults to "auto" which gives the browser some discretion in layout, and
different browsers will come up with different results.
 
L

Leslie

My fault. I meant to write "margin-left" and "left."

If you specify only one dimension when doing positioning, the other one
defaults to "auto" which gives the browser some discretion in layout, and
different browsers will come up with different results.

That did it! Thank you very much!!

Leslie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top