Piet Skiet
New member
okay, so i've just learnt how to use 'div' to create sections in html and i can position them but how can i just center align a section so that irrespective of screen resolution, it will appear in the middle. here is my simple code which aligns it a bit to the left but how could i change it to align in the centre:
<html>
<head>
<title>Example</title>
<style type="text/css">
div.1a {
position: absolute;
top: 0px;
left: 100px;
width: 600px;
padding: 0px;
height: 300px;
border: 1px dashed blue;
}
</style>
</head>
<body>
<div class="1a">
Text goes here
</div>
</body>
</html>
<html>
<head>
<title>Example</title>
<style type="text/css">
div.1a {
position: absolute;
top: 0px;
left: 100px;
width: 600px;
padding: 0px;
height: 300px;
border: 1px dashed blue;
}
</style>
</head>
<body>
<div class="1a">
Text goes here
</div>
</body>
</html>