How do I make an existing website in Dreamweaver center in the browser window?
Observing members:
0
Composing members:
0
1 Answer
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
This question is in the General Section. Responses must be helpful and on-topic.