Forum Moderators: not2easy

Message Too Old, No Replies

Help on CSS -looks good in IE6, does not work in netscape7

Any suggestions?

         

Web Footed Newbie

2:23 pm on Jul 1, 2003 (gmt 0)

10+ Year Member



Hello folks.
Here is my CSS from a prior thread: message #8
[webmasterworld.com ]
<div id="center">All your main content</div>
<div class="clear"></div>
<div id="left">Left stuff</div>
<div id="right">Right stuff</div>
<div id="head">Head stuff</div>
<div id="footer">Footer stuff</div>

body { height: 100%; }
#center { width: 400px; margin: 70px 0 0 180px; }
#leftcol { width: 180px; position: absolute; top: 70px; left 0; }
#rightcol { width: 180px; position: absolute; top: 70px; left: 580px; }
#head { position: absolute; top: 0; width: 760px; height: 70px; }
#footer { ... }

This layout acheived my Objective: the main content being the first content a spider would see (comes up first in the HTML).

The CSS validates, the HTML 4.01 loose validates.

But the problem is it does not layout at all in Netscape 7.02.

Any help with this? Thanks, WFN :)

moonbiter

3:47 pm on Jul 1, 2003 (gmt 0)

10+ Year Member



Er, first off, your ids don't match up between your html and your css in the example you give.

Secondly, try:

body { height: 100%; margin: 0; padding: 0; }

although I don't know what you have the height in there for ...

Spook

4:01 pm on Jul 1, 2003 (gmt 0)

10+ Year Member



It displays fine in Netscape 7.01 with the correct id's in the HTML.

Can't see why it should foul up in a later version!

If you have cut and pasted your code, there is a : missing here though:-

#leftcol { ..... left 0; }

Spook

mipapage

1:56 am on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What about the xml declaration at the top of the page? Do you have that up there?

<?xml version="1.0" encoding="iso-8859-1"?>

If that bit is at the top, usually a page will render differently between the two than if it wasn't there.

If it is there I'd get rid of it - it throws IE into 'quirks mode', which means 'less standards compliant'. It's also not necessary, as you can specify your encoding here:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Maybe this helps? (Remember, that version of netscape you're talking about is waaay more standards complient than IE)

Web Footed Newbie

2:41 am on Jul 3, 2003 (gmt 0)

10+ Year Member



Thanks, mipapage,

My HTML valids with 4.01 loose.

My CSS validates with CSS 2.

I'm trying to figure if it is just my netscape 7.02 on my computer, but none of my friends use netscape :(

I'll know if it is my version by tomarrow, hopefully.
Thanks, WFN

DrDoc

3:40 am on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just to make sure... You haven't enclosed your styles in HTML comments <!-- -->, have you?

moonbiter

2:33 pm on Jul 3, 2003 (gmt 0)

10+ Year Member



I think we need a little better description of what "does not layout at all" means. I took your example code and dropped it into a basic html document (4.01 Transitional doctype), made the following small changes (strongly highlighted):

style block:

<style type="text/css">
/*
Colors added so we can see the divs, padding and
margin zeroed to get around the browser defaults
which break the layout. Also made the fix to left
in #leftcol that Spook caught.
*/
body { height: 100%; margin: 0; padding: 0; }
#center { width: 400px; margin: 70px 0 0 180px; background: green;}
#leftcol { width: 180px; position: absolute; top: 70px; left: 0; background: red; }
#rightcol { width: 180px; position: absolute; top: 70px; left: 580px; background: yellow;}
#head { position: absolute; top: 0; width: 760px; height: 70px; background: blue; }
#footer { ... }
.clear { clear: both; }
</style>

body block:

<body>
<!-- Modified ids to leftcol and rightcol to match css -->
<div id="center">All your main content</div>
<div class="clear"></div>
<div id="leftcol">Left stuff</div>
<div id="rightcol">Right stuff</div>
<div id="head">Head stuff</div>
<div id="footer">Footer stuff</div>
</body>

This gives me a standard 3-column layout with a header, 760px wide, with a blue head, red left column, yellow right column, and green center column. I can see nothing wrong with it in either MSIE 6(sp1), Mozilla 1.4, Netscape 7.0, or Opera 6.05 or 7 (all on Win2k). So either the problem is with something else in your markup, or I have no idea what this layout is suppose to look like.

mipapage

10:29 pm on Jul 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Web Footed Newbie...

Fwiw - What I mentioned will validate either way. The xml prologue.... Think of it as a 'switch':

If it's there, its valid and IE6 runs in 'quirks mode'

If its not there, its valid and IE6 runs in *cough* 'standards compliant mode'.

To recap - Nothing to do with validation whatsoever.

To say it yet another way, if you have the xml prologue there, I'll bet you that's your problem. And if it's not your problem, I'd take it out anyway!

DrDoc

4:59 am on Jul 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The XML prologue is not the problem since the page validates against HTML 4.01 Loose ;)

However, are you using a full doctype or not? And, just as a reference, would you mind posting the doctype you're using?

mipapage

3:41 pm on Jul 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<banging head> Right! So dumb of me. HTML, not XHTML. Now I get it.