css screen resolution problem

  • Darren a
  • Born
  • Born
  • Darren a
  • Posts: 3
  • Loc: Eastern Pennsylvania

Post 3+ Months Ago

Ok, I've been playing around with CSS for the first time today and so far it's not so bad but I have encountered one problem. The site I am working on is very simple and it renders well at 1024*768, but when I view it at 800*600 I get a 2 inch horizontal scroll bar. I've tried everything from adjusting margins to percentages, setting div width to various percentages and pixels, and even nesting into tables. No matter what I just cant get rid of the scroll.

Can anybody give me any suggestions?

Quote:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF"leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<div id="main" style="position:absolute; margin-left:150px; width:75%; height:565px; z-index:1; left: 0; top: 0; "><img src="library/background.gif" width="758" height="558">

<div id="header" style="position:absolute; margin-left: 160px; width:475; height:59px; z-index:1; top: 38px; left: 0; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000"></div>

<div id="nav" style="position:absolute; margin-left: 180px; width:449px; height:38px; z-index:2; left: 0px; top: 430px; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000"> </div>

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


One other question. Is it acceptable to nest div tags?

thanks,
darren
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

I am not real good with CSS, but maybe if you set your margins to a percentage as well you may get what you want. But if I am wrong I am sure someone will correct me
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

I'm pretty sure it's the use of the 150px left-margin in addition to the
background image. If you add the 2 together (which is what the browser
sees) you get 908 pixels. ;)
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

yes, btw, it is acceptable to nest DIV's.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 25 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.