Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Schrinking <DIV> in NS 1

Status
Not open for further replies.

Dragonfish

Programmer
Apr 25, 2001
62
0
0
UG
Using <div>-tags to define area bloks works fine (except that NS caps the text in the child <div>s but the real problem is that when I make the browser smaller the areas collapse in NS. I tried clip in the stylesheets but that did´nt help. Does anyone know why NS does this and how to prevent it. Here´s the file:

<!doctype html public &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<html>
<head>
<title>Anything</title>
<STYLE TYPE=&quot;text/css&quot;>
<!--
#ParentOne {position: absolute; border: none; left: 10px; top: 10px; width: 300px; height: 200px; background-color :#FFFFFF; layer-background-color:#FFFFFF; clip: hidden;}
#ParentTwo {position: absolute; border: none; left: 320px; top: 10px; width: 300px; height: 200px; background-color :#FFFFFF; layer-background-color:#FFFFFF; }
#ChildOne {position: absolute; border: none; left: 10px; top: 30px; width: 280px; height: 20px; background-color :#FFFF00; layer-background-color:#FFFF00; }
#ChildTwo {position: absolute; border: none; left: 10px; top: 60px; width: 280px; height: 130px; background-color :#FFFF00; layer-background-color:#FFFF00; }
-->
</STYLE>
</head>
<body bgcolor=&quot;#9F0000&quot;>
<DIV ID=&quot;ParentOne&quot; z-index=1>ParentOne</DIV>
<DIV ID=&quot;ParentTwo&quot; z-index=1>ParentTwo
<DIV ID=&quot;ChildOne&quot; z-index=2>ChildOne</DIV>
<DIV ID=&quot;ChildTwo&quot; z-index=2>ChildTwo</DIV>
</DIV>
</body>
</html>

Thanks in advance
DavidinGermany
 
seems to me like you have two things going on here!!

firstly NS4 doesnt really support nested divs though they do work sometimes!

secondly NS4 screws up just about every webpage with something more advanced than a p tag in if you resize it. Basically resizing the window in NS4 and maintaining a decent look is a no go unfortunately. Not to worry maybe in 6-8 months we can stop developing for it all together (oh joy!).

In the meantime one way around this is to put this in your body tag

onresize=&quot;if(document.layers) window.self.location.reload();&quot;

this will force the browser to refresh if resized but only for NS4. I know its not standards compliant event handler but it does work.

good luck

rob
 
oh btw

i just noticed that you have z-index specified as an attribute in your div tags.

z-index is a css property and hence should be specified in your stylesheet like this

#ParentOne {position: absolute; border: none; left: 10px; top: 10px; width: 300px; height: 200px; background-color :#FFFFFF; layer-background-color:#FFFFFF; clip: hidden; z-index:1}

it works in your code as the divs are displaying in the order they appear on the page.

hope this helps

rob
 
Thanks for the reply Rob. Yoú´re right about NS4x though - what a headache

DavidinGermany
 
Rob, can you explain what you mean with &quot;Not to worry maybe in 6-8 months we can stop developing for it all together (oh joy!).&quot;

Erik
 
Hi Erik,

I guess what i mean is wouldnt it be lovely to not have to put all the nasty workarounds we use for netscape 4 into our code. For the sort of work the we do most of our sites have about 3-5% NS4 users. Still we develop to cater for their needs. Its a hassle, takes extra time and on occasion means horrible fudges to get stuff to work in NS4 and validate (especially to the W3C XHTML1.0 doctype).

Looking to the future i hope (maybe its wishful thinking) that in the next 6-8 months (maybe a year) we will have a small enough %age of NS users that we can stop supporting the browser and develop primarily for IE5+ and NS6.

Admittedly its not that clearcut as there are lots of other browsers which we suppport to some extent though most dont get full functionality. That in my opinion is the users choice.

AOL is a bit of a misnomer in that department too as the market share is going up, i guess when we stop developing for NS4 we will start having to consider AOL more thoroughly (ARGGHHHH).

Whatever the future holds im firmly of the opinion that the longer we support NS4 users the longer it will take them to upgrade. Maybe we can push things along a little if we give them an incentive!

Whats your thoughts on the matter - i'd be interested to hear them.

rob
 
Thanx for explaining Rob,

I'm only web-programming for 18 months and started as a complete beginner. (It was hard to learn developing web-sites after working for 18 years as an electrical designer/consultant). Because the main work I do is developing/maintaining an database-driven Intranet based on Internet Explorer, I don't have much experience with developing sites for other browsers. But my next two challenges in the future are making a complete new Internet site and rebuilding our Intranet probably also for cross-browser, because of some (internal) special reasons. (so that's why I asked you to explain).

So I spend some time the last 3-4 months to learn on the web about the different supports by the different browsers. To hear other devellopers thoughts I want to make a plan to advice my boss so he can make a decission for which browsers(-versions) we will devellop our sites.

So now my opinion: I think (hope) you are right about the NN4+, but onestly I'm affraid that the differences between IE5+ and NN6+ are also more then we want ?? But again , my experience whit those versions are still less, so the future will clear that for me LOL.

Erik My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !!
 
netscape 4.7 supports nested divs just fine. they are part of the document obj of the parent div...

<div id=&quot;div1&quot;><div id=&quot;div2&quot;></div></div>

so to access div2 its :

document.div1.document.div2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top