Centralise site on page

They have: 1 posts

Joined: Feb 2008

I would like my site to appear cebtrally within the browser window after resizing or regardless of the screen resolution.

Is this fairly easy to do? The site has been created using dreamweaver MX
and is at the following URL

http://www.1stautoclear.co.uk/

regards

Paul
Webmaster 1st Auto Clear

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Change this line:

<div id="Layer1" style="position:absolute; width:767px; height:729px; z-index:1; top: 0px; left: 0px;">

to:
<div id="Layer1" style="width:767px; margin: 0 auto;">

Unfortunately Internet Explorer doesn't support standards, so we'll have to add in a hack for that browser, so change:

<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
.style2 {font-family: Arial, Helvetica, sans-serif}
.style3 {font-size: 10px}
-->
</style>

to:
<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
.style2 {font-family: Arial, Helvetica, sans-serif}
.style3 {font-size: 10px}
body { text-align: center; }
#Layer1 { text-align: left; }
-->
</style>

Give that a try and let us know how you get along. Smiling

a Padded Cell our articles site!

He has: 629 posts

Joined: May 2007

I'm afraid your page is broken in all my browsers this end. See this screen grab from IE 7: http://webwiz.robinshosting.com/temp/images/1stautoclear.png

I suggest using floats instead of absolute positioning for the images. That way the text will wrap the images.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.