2) Harder Content to Center
It gets harder to achieve the desired results when you have colored boxes that you want to extend across the whole page, while keeping the content centered in the browser window (see figure 4 for an example of this). Using the method in Figure 1 will not allow us to have our background colors expand across the page, while still centering the content on the page (this can be seen in Figure 2). Notice that the background colors don’t expand across the whole page.
Header info
Main content info
HTML Code
<body>
<header>
<h1>Header info</h1>
</header>
<div id="main">
<h1>Main content info</h1>
</div>
<footer>
<h1>Footer info</h1>
</footer>
</body>
CSS Code
body{
width: 50%;
margin: auto;
}
This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piƱa coladas. (And gettin’ caught in the rain.)
…or something like this:
The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.
As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!