Hi guys,
I’m a New User of CSS and seem to be havign a spot of bother making a <div> centre. I was under the impression that I set margin:auto; in my css (have also tried margin-left (and right):auto; ) however for some reason the <div> is stayed left justified.
Please can you assist before i go mad! ( well madder)
html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>TDP Surveyors - Surveying & Valuations experts in Cornwall</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="/css/tdp.css"
</head>
<body class='background'>
<div class="body">
<div class="logo"><img src="/images/TDp-Square-green-txt1.jpg" /></div>
</div>
</body>
</html>
with associated CSS
.background{
background-color: #333333;
}
.body {
padding: 3px;
border: 1px solid black;
background-color: white;
top:5px;
width:1400px;
height:1000px;
margin:auto;
}
the weirdest thing is that wheni preview in browser from dreamweaver it works, but when uploaded and viewed via the web it becomes justified tot he left!?!?!?