That's a real hack looking piece of code. Not that that's a bad thing but, you will be doing alot of it if you do a little of it and it can tend to clutter up your mark up. Anyways, once you use position:absolute and give a coordinate for top or left, you lose any centering. You may be able to regain the center with clever padding or margins but, best to avoid the absolute positioning to begin with. If you want it at the top and centered, place your element just after the <body> tag. Like this:
HTML Code:
<body style="margin-top:0">
<h1 align="center" style="margin-top:0">My Heading</h1>
or using an on page stylesheet, which is a better habit:
Code:
<html>
<head>
<title>My Title</title>
<style type="text/css">
body {
margin-top:0;
}
h1 {
margin-top:0;
text-align:center;
}
</style>
</head>
<body>
<h1>My Heading</h1>
Bookmarks