DIV Height, Width, and Centering

liunx

Guest
I've got two problems that I can't seem to figure out.

1. I have a div that contains all of the elements on a page and is set to be centered on a page. It's works fine in all browsers except IE for the MAC.

2. I have another div that has a background image and it's width and height are set to the size of that image. However it only shows the image in IE for PC.

Any ideas on these two issues? Thanks!1. Does it look like this:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>center contents</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">
<!--
body {
text-align:center;
}
#container {
margin:0 auto;
width:600px;
text-align:left;
}
#contents {border:1px solid red;}
-->
</style>

</head>
<body>
<div id="container">
<div id="contents">
<p>centered contents</p>
</div>
</div>
</body>
</html>


2. Have you set the background image position to top left1. Here's what the code looks like.
HTML Code:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title></title>
<link href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.oursite.com/screen.css" rel="stylesheet" type="text/css" media="all">
</head>
<body>
<!-- #include file="Header.html" -->
<div align="center">
<div id="Container">
</div>
</div>
<!-- #include file="Footer.html" -->
</body>
</html>

CSS Code:
#Container {
text-align: left;
margin-top: 40px;
margin-bottom: 40px;
z-index: -1;
width: 760px }

2. The image is set to top left.
 
Back
Top