473,378 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1467
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Martin Fuchs | last post by:
Hello, I did a HTML site validating HTML 4.01. The layout works alright in Internet Explorer 6, Opera 7 and Netscape 6 but it does not display correctly in Netscape 7 and Mozilla 1.5. Spaces...
39
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
3
by: Doug McCrae | last post by:
http://www.btinternet.com/~doug.mccrae/go4learning/index.html As it says in the subject, a two column layout (plus header and footer boxes). I feel the left column really needs to be fixed width...
21
by: Amy | last post by:
Hello all, Well, I've decided to take the plunge and go for this no table theory... so far I'm not impressed - the whole thing is driving me mad!!!! I'm sure once I finally get it working...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
7
by: Xavier Onassis | last post by:
I would be grateful for recommendations for a CSS layout (header, 2 cols, footer) that can accomodate dynamically added elements. I am not having any luck so far getting this to work in...
4
by: Rob Freundlich | last post by:
I have some servlet-generated tabular data that I need to present, so I'm using an HTML Table. In some cases, it can be quite large. I'm flushing the servlet output every N lines to push the data...
4
by: NWx | last post by:
Hi, I develop an ASP.NET app which should be used from Internet, so I don't have control over what browsers will be used. I don't want to target every possible users, so I don't really mind is...
10
by: Luke | last post by:
Hi. I am trying to make correct layout, here is an example of (dynamically generated content via jsp): http://localhost/www/layout.htm Most outer div is positioned absolute (if not then it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.