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
1 response
“Great Question” (0points)
Observing members: 0
Composing members: 0

Answers

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.

Mobile | Desktop


Send Feedback   

`