[thelist] Trying to center using CSS

Amy Johnson amy at rocky-hills.com
Tue Aug 13 14:11:00 CDT 2002


Hi all.  Thanks for the input on my problem (especially thanks to Mark G for pointing out other problems).  With your help I have
gotten my web page to center on the screen in IE6.  But, I still can't get it to center in Netscape 6.  I have put some very simple
files together to illustrate the problem.  Any suggestions would be greatly appreciated.

(and to explain...DIV.NSbug seems to be the only way I can get Netscape to read my BODY attributes.	And I believe that I *have* to
set DIV.box to position:relative since I have items with absolute positioning within DIV.box.)


Thanks!
Amy


===============================================
STYLE.CSS
===============================================
<style>
<!--
DIV.NSbug       {background-color: black;}

BODY            {background-color: black;
                margin: 0;
                padding: 0;}

DIV.main        {color:white;
                width: 100%;
                margin: 0;
                text-align: center;}

DIV.box         {position: relative;
                height: 550px;
                width: 600px;
                margin-top: 70px;
                margin-bottom: 70px;
                border-style: outset;
                border-width: 5px;}

P.text          {position: absolute;
                top: 50px;
                right: 50px;}
-->
</style>

============================================
TEST.HTML
============================================
<html lang="en-US">
<head>
<link rel=stylesheet type="text/css"
      href="style.css">

</head>
<body>
  <div class=main>
    <div class=box>
	<p class=text>This is a test. This is a test</p>
    </div>
  </div>
</body>
</html>
=============================================





More information about the thelist mailing list