General Question

mjstinson's avatar

How do I make an existing website in Dreamweaver center in the browser window?

Asked by mjstinson (1points) June 15th, 2009
Observing members: 0 Composing members: 0

1 Answer

noyesa's avatar

If all of your content is wrapped in a block-level element, then you can center them using CSS. Assuming with have a div with an id of “wrapper”, you could use the following CSS rules:

div#wrapper { margin: 0 auto; }

Note that this will only work for standards-compliant browsers. Most IE versions don’t apply the rule correctly, so you have to use a fix that stems from IE’s misuse of the text-align property:

body { text-align: center; }
div#wrapper { text-align: left; margin: 0 auto; }

Note that div#wrapper must have been assigned some sort of specific width, or else its width is simply 100% and it won’t be moved.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther