Difficulty getting desired behaviour from older browsers!

liunx

Guest
Hi Everyone, <br />
<br />
Sorry about the subject heading being undescriptive. I am trying to get a box effect on screen (e.g.: using a background image for the entire page and then using an image inside the pages table). This isn't the easiest thing to describe, basically I have a background image for the entire page and inside that image I wan't to put another image for the background of the tables that I am using for page layout. Effectively it is like having two pieces of coloured paper, the first piece is the full page and the second is a slightly smaller piece, giving the effect of only showing about one centimeter of the first piece. I hope that this isn't impossible to understand, why is it so difficult to describe something so simple!<br />
<br />
I have used cascading style sheets to achieve this by doing the following.<br />
<br />
<style type="text/css"><br />
.box<br />
{<br />
margin-bottom:5px;<br />
margin-left:5px;<br />
margin-right:5px;<br />
margin-top:5px;<br />
}<br />
</style><br />
<br />
Then applying this to my "master" (top level) table as follows:<br />
<br />
<body background="../pictures/backgrounds/background_three.jpg"><br />
<table background="../pictures/backgrounds/background_two.jpg" class="box" width="98%"><br />
<br />
This approach works in the new browsers (which have good css support) however when I try viewing this code in Netscape 4.7 or earlier I get some really ugly (disjointed) results.<br />
<br />
Is there any way of achieving what I am trying to achieve using JavaScript or something similar (something that will work better in the older browsers?)?<br />
<br />
Thanks for your time.<br />
<br />
Regards<br />
<br />
David<!--content-->You might be better using @import to hide your css and then ignoring Netscape 4 - or at least hiding those styles that it cannot understand...<!--content-->yeah, don't feel bad if netscape 4* makes a mess of your page - it predates the concept of web standards by at least a couple of years. It's not really a web browser any longer, more like a virus which needs to be eliminated from the world's computers. So don't waste your time with it - test with a standards-compliant browser like Opera (<!-- m --><a class="postlink" href="http://www.opera.com/">http://www.opera.com/</a><!-- m -->) and also a text browser like Lynx...problem solved :)<!--content-->If you really want NS4 to work with the code, enclose your table in a DIV and set the paddding:<br />
<br />
<br />
<body background="../pictures/backgrounds/background_three.jpg"><br />
<div style="padding:5px;"><br />
<table background="../pictures/backgrounds/background_two.jpg" width="98%"><br />
</table><br />
</div><!--content-->Just a quick q: Why use tables at all if you know CSS?<!--content-->Originally posted by omega <br />
Just a quick q: Why use tables at all if you know CSS? <br />
<br />
If you HAVE to code a site for NS4 and other browsers who handle CSS so poorly that you can pretty much only have to use tables, then you could. Not saying it's the best because it isn't, but sometimes you have to do the dirty deed. Granted the need to code for NS4 and other early browsers is becoming nil. I would only do it if somebody told me I had to do it.<!--content-->I can see your point, but here's how I handle backwards compatibility: I turn off styles. Is it still sensical, maybe even more so? Yes? Then I'm done with backwards compatibility. Otherwise I just check for Internet Explorer and Firefox.<!--content-->
 
Back
Top