dreamweaver centring in browser

  mco 23:58 19 May 06
Locked

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 06

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 06

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 06

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 06

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

  splatter 16:24 27 May 06

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;
}
</style>

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 06

thanks!

  splatter 23:32 27 May 06

Just spreading the knowledge :)

  PurplePenny 17:46 28 May 06

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

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

  splatter 12:52 02 Jun 06

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.

New Google phones UK release date | Pixel XL price, new features, specifications: Pixel X and…

1995-2015: How technology has changed the world in 20 years

This is the future of TV, VR and holograms

iOS 10 troubleshooting tips: Simple fixes for the most common iOS 10 problems, from network…