The following tutorials will show you how to center your website using an ID selector in CSS.
THINGS YOU MIGHT NEED:
CSS basic knowledge
HTML file
External CSS file
HTML File:
<body>
<div id="page-wrap">
all websites HTML here
</div>
</body>
In other to avoid margin conflicts when resizing your window, it is very important to set the width of the selector to a giving pixel ( e.g 800px ) and also set the margin's initial value to 0 and auto to horizontally center the page.External CSS File: #page-wrap {
width: 800px; margin: 0 auto; }