Center a website
Learn how to center a website
As we plan tutorial content for the Creative Cloud products, we work to balance the learning material between user-requested content and other initiatives. Learning how to center a website was one of the most requested topics we have ever received.
The Center a website tutorial from the Dreamweaver Learn and Support page describes how to structure a web page with HTML and then use simple CSS to center the content within the page. This tutorial also provides project files you can use to try the concepts on your own.
Below is a summary of the steps that are described with more context in the tutorial:
Step 1 – Define structure with HTML:
Create a <div> around the content of the page and assign it a unique id.
Step 2 – Center content with CSS:
Use the CSS margin property to center the container <div> in the page.
margin: 0 auto;