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!

What's wrong with this simple page?

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
0
0
CA
Hi folks

I'm having a terrible problem where I can't get Netscape 6.0 to display this page the way I want it to. IE 5 or 6 displays it fine. At issue is the main content "box". I want it to be 100% of the page. IE does this fine. NN6 stops it at some apparently predetermined length. My page is much more complex than this, but I've broken it down to basics to figure out the problem. This code is only long because I've generated 15 paragraphs of nonsense to show the problem.

Here's the code...PLEASE try it out!

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>

<html>
	<head>
		<title>Why doesn't this work?</title>
		<style type=&quot;text/css&quot;> 
			/*HTML Tags*/
		body {
		height:100%;
		background-color: #ADBA9C;
		font:11px/20px tahoma, verdana, arial, helvetica, sans-serif;
		}
		
		/*end HTML Tags*/
		
		/*ids*/
		#mainsection {
		padding: 3px;
		background-color: #ffffff;
		border: 1px #000000 solid;
		left: 10px;
		position: absolute;
		top: 134px;
		width: 700px;
		height: 100%;
		}
		
		#header {
		padding: 3px;
		background-color: #FFFFFF;
		border: 1px #000000 solid;
		left: 10px;
		position: absolute;
		top: 3px;
		width: 700px;
		height: 125px;
		}
		
		#footer {
			text-align:center;
			font-variant: small-caps;
			color:#ADBA9C;
			font-size:11px;
		}
		</style>
	</head>
	
	<body>
		<div id=&quot;header&quot;>
			HeaderTEXT
		</div>
		<div id=&quot;mainsection&quot;>

			HERE IS THE BODY

		</div>
	</body>
</html>

Thanks!

Ben
 
netscape does not recognize the <div> tags. I'm not sure about NN7 though. look into converting them to <layer>'s

_________________________________________________________
[sub]$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;[/sub]
onpnt2.gif
[sup] [/sub]
 
Netscape is really strict about height and width when working with DIV's.
What I did and it's working is just get rid of the height=100%. The box will stretch as long as you have contents.
Now I know what the next problem is going to be if you don't have enough text in the box you'll end up with a small box on top and a lot of unused space all around.
What I did is create a small transparent image and align it to the left gave that image a 1px width and 450px height.

That way the box still fills a big chunk of the screen but the text is only two or three lines.

The other way I found that works.
#mainsection {
padding: 3px;
background-color: #ffffff;
border: 1px #000000 solid;
left: 3px;
position: relative;
top: 138px;
width: 700px;
height:100%;
}
It stretches the white box all around the text, all the way to the bottom.

 
Another thing I found is that comments in the <STYLE> section will sometimes cause Netscape to fail. IE is much more accepting of mistakes and deviations from the true standard. The things that Netscape does implement, usually need to be followed to the letter.


Einstein47
(&quot;Vision without action is a daydream - Action without vision is a nightmare. Japanese Proverb&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top