Hello World!

This example supposingly contains some "advanced" CSS methods which I may not have learned yet. The tutorial will explain these methods later, but strangely, all is familiar to me! Maybe it is the education I got in the HTML tutorial, which touched on quite a bit of CSS. But even though I've run into some brick walls (especially with the margin and padding confusion!), I am really having fun with this CSS thing. It's complicated but I'm determined to "know it all!"


In the stylesheet:
body {
    margin-left: 200px;
    background: #5d9ab2 url(path to imagefile) no-repeat top left;
}
.container {
    text-align: center;
}
.center_div {
    border: 1px solid gray;
    margin-left: auto;
    margin-right: auto;
    width: 90%;
    background-color: #d0f0f6;
    text-align: left;
    padding: 8px;
}
In the body:
<div class="container">
  <div class="center_div">
    <h1>Hello World!</h1>
    <p>A paragraph</p>
  </div>
</div>

Back button Table of Contents Next button