dreamweaver centring in browser

  mco 23:58 19 May 2006

Ok; I'm branching out from NOF and attempting a test site in dreamweaver so please excuse all very basic obvious questions over the next few weeks! I'm a very much trial and error person ,rather than reading manuals, so I'm making it up as I go along -but my first query is: at the moment it's all on the left hand side of my screen. In NOF there's just a box to tick to 'centre in browser' - but how do I achieve the same in dreamweaver - and will it work for whichever size screen people are looking at? Thanks!

  RicScott 15:41 20 May 2006

If you are using tables..Load the site up in Dreamweaver and click to the right of the content..(just outside the box), If you can't get to it, Minimise the section on the right by clicking the little right facing arrow about half way down the page.
Now in the properties section just click to center align the whole page..This will align the page into the center for you..click here
for an example of what I think you mean.

This centers the whole page what ever size the resolution is of the visiting browser.

  mco 20:26 20 May 2006

I'm not using tables, though maybe I should start again with tables? I just made a blank page and put layers on it - is it now impossible to centre what I've got?

  mco 00:46 21 May 2006

I clicked where you said. I redid the page in tables,clicked, found 'align' then 'centre' but it still doesn't seem centred to me..

  mco 01:20 21 May 2006

it has worked, once I did it correctly -thanks!

  splatter 16:24 27 May 2006

Just for reference, to do it with CSS and layers requires a little bit of basic trickery.

1. Remember this goes in the head of your document, or a seperate stylesheet

2. If you use a stylesheet remove the <style> and </style> tags.

<style type="text/javascript" media="screen">
#container {
margin-top: -290px;
margin-left: -375px;
position: absolute;
top: 50%;
left: 50%;
width: 750px;
height: 580px;
visibility: visible;

Basically, 'margin-left' and 'margin-top' should be set to exactly half of your width and height.

The 'top' and 'left' should always be set to 50%

Then you need your actual layer code:

<div id="container">Rest of your content</div>

This should also compy with XHTML 1.1 if your bothered about that sort of stuff.

  mco 20:54 27 May 2006


  splatter 23:32 27 May 2006

Just spreading the knowledge :)

  PurplePenny 17:46 28 May 2006

"<style type="text/javascript" ..."

I don't think you meant to write that :-)

  splatter 12:52 02 Jun 2006

Sorry for bumping a resolved thread but, PurplePenny, your right. It should read:

<style type="text/css" media="screen">

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

Photoshop CC 2018 released with new Curvature Pen and better brush tools

Camera tips to take better iPhone photos

Les meilleures applications de covoiturage 2017