469,270 Members | 1,831 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

CSS layout works OK in Netscape, sucks in IE - Help please

Hello

I'm trying to implement the page layout mocked up here:
http://www.walkourworld.com/
so the page behaves tidily when a user alters the browser window width.

There's a first attempt here, which works fine in Netscape 7.2 and also
in Mozilla Firefox/DeerPark v1.6a1.
http://www.walkourworld.com/workshop/test_template.html

Display the same page in Internet Explorer 6 and it looks awful.

One problem is the the 'div's which have variable width (eg: the centre
section of the banner at the top, or the "filler" to the right of the
Welcome tab) don't have the background image or specified bgcolor
painting across the full extent of the 'div', only that portion of it
actually occupied by text or 'nbsp's.

This is the sort of CSS running into trouble:

#banner_middle
{
position: absolute;
left: 350px;
right: 271px;
top: 0;
height: 79px;
background-image: url("banner_middle.gif");
background-repeat: repeat;
}

I've got some JavaScript in the page <headsection which links in a
different stylesheet file if IE is the browser and tried making a few
adjustments in there, like margin-left and margin-right instead of left
and right - like so, but to no effect:

#banner_middle
{
position: absolute;
margin-left: 350px;
margin-right: 271px;
top: 0;
height: 79px;
background-image: url("banner_middle.gif");
background-repeat: repeat;
}

Can anyone point me towards any online resource dealing with these
browser inconsistencies or offer any suggestion for a solution.

CSS files are:
http://www.walkourworld.com/workshop/wow_layout.css
http://www.walkourworld.com/workshop/wow_layout_ie.css

Many thanks for any helpful suggestions

Charles B

Aug 30 '06 #1
6 1355
Charles B wrote:
http://www.walkourworld.com/workshop/test_template.html
I've got some JavaScript in the page <headsection which links in a
different stylesheet file if IE is the browser
Have you looked at the page with JavaScript disabled? There is no
stylesheet. How will your page work for the ~10% who have JavaScript
disabled, or who are behind corporate firewalls that strip it?

Why the "browser.isNetscape" stuff if you are only sniffing for IE?

--
-bts
-Motorcycles defy gravity; cars just suck.
Aug 30 '06 #2
Hi Beauregard:
http://www.walkourworld.com/workshop/test_template.html
I've got some JavaScript in the page <headsection which links in a
different stylesheet file if IE is the browser

Have you looked at the page with JavaScript disabled? There is no
stylesheet. How will your page work for the ~10% who have JavaScript
disabled, or who are behind corporate firewalls that strip it?
I only put the template_test.html page onto the live server to link
from this thread - the ideal is a CSS file which works with all fairly
modern browsers, and no need for JavaScript in public areas of the
site.
Why the "browser.isNetscape" stuff if you are only sniffing for IE?
... because I copied the snippet of script from somewhere else ... and I
may find there are other browsers I need to sniff for before the
exercise is done.

Your contribution is appreciated.

Charles B

Aug 30 '06 #3
Charles B wrote:
Hi Beauregard:
Good morning.
>>http://www.walkourworld.com/workshop/test_template.html I've got
some JavaScript in the page <headsection which links in a
different stylesheet file if IE is the browser

Have you looked at the page with JavaScript disabled? There is no
stylesheet. How will your page work for the ~10% who have JavaScript
disabled, or who are behind corporate firewalls that strip it?

I only put the template_test.html page onto the live server to link
from this thread - the ideal is a CSS file which works with all
fairly modern browsers, and no need for JavaScript in public areas of
the site.
Ah. Well, there are those conditional statements you can place directly
in the CSS that may work better. I don't use them. but they would work
something like this, I think:

<link rel="stylesheet" type="text/css" href="wow_layout.css"
<!--[if IE]><link rel="stylesheet" type="text/css"
href="wow_layout_ie.css"><![endif]-->

>Why the "browser.isNetscape" stuff if you are only sniffing for IE?

.. because I copied the snippet of script from somewhere else ... and
I may find there are other browsers I need to sniff for before the
exercise is done.
Browser sniffing is generally doomed to failure. <g>

While you are pondering your pixel-perfect layout, have a read of this:
http://k75s.home.att.net/fontsize.html

You will also want to assign a background color to the body. I get to
see my ugly default purple...

--
-bts
-Motorcycles defy gravity; cars just suck.
Aug 30 '06 #4
Beauregard T. Shagnasty replied to hisself:
Ah. Well, there are those conditional statements you can place
directly in the CSS that may work better.
Oops, sorry. I meant to say in the <headinstead of in the CSS.

--
-bts
-Motorcycles defy gravity; cars just suck.
Aug 30 '06 #5
Thanks for your useful suggestions Beauregard
>http://www.walkourworld.com/workshop/test_template.html
>
Ah. Well, there are those conditional statements you can place directly
in the CSS that may work better. I don't use them. but they would work
something like this, I think:

<link rel="stylesheet" type="text/css" href="wow_layout.css"
<!--[if IE]><link rel="stylesheet" type="text/css"
href="wow_layout_ie.css"><![endif]-->
An excellent suggestion - I'll try that tomorrow; I haven't used
HTML-comment conditionals previously.
>
Why the "browser.isNetscape" stuff if you are only sniffing for IE?
.. because I copied the snippet of script from somewhere else ... and
I may find there are other browsers I need to sniff for before the
exercise is done.

Browser sniffing is generally doomed to failure. <g>

While you are pondering your pixel-perfect layout, have a read of this:
http://k75s.home.att.net/fontsize.html
Some good points on your linked page - I've stripped the Verdana out,
and I'll check out which are the best-looking percent values for h1,
h2, etc.
You will also want to assign a background color to the body. I get to
see my ugly default purple...
Should look better now I hope!

Many thanks for your help.

Charles B

Aug 30 '06 #6
Charles B wrote:
Thanks for your useful suggestions Beauregard
>>>>http://www.walkourworld.com/workshop/test_template.html
<schnipp>
An excellent suggestion - I'll try that tomorrow; I haven't used
HTML-comment conditionals previously.
Neither have I. Never had the need to browser-sniff.
>Browser sniffing is generally doomed to failure. <g>

While you are pondering your pixel-perfect layout, have a read of this:
http://k75s.home.att.net/fontsize.html

Some good points on your linked page - I've stripped the Verdana out,
and I'll check out which are the best-looking percent values for h1,
h2, etc.
Ok.
>You will also want to assign a background color to the body. I get to
see my ugly default purple...

Should look better now I hope!
bgcolor: #fff;
should be
background-color: #fff;

...'cause I still see purple. <g bgcolor is not a valid attribute.
Many thanks for your help.
Welcome.

--
-bts
-Motorcycles defy gravity; cars just suck.
Aug 30 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

39 posts views Thread by Zak McGregor | last post: by
3 posts views Thread by Doug McCrae | last post: by
21 posts views Thread by Amy | last post: by
47 posts views Thread by Neal | last post: by
7 posts views Thread by Xavier Onassis | last post: by
4 posts views Thread by Rob Freundlich | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.