CSS Lesson 2: Background Colour and Containers

Hi Everyone,

As you may have noticed my previous post about CSS was written on an HTML document. Although today we will be using a CSS document!

Today we will be learning how to change the background colour and create containers in a CSS document.  When creating containers we will need to also need to create some code in an HTML document.

Let’s start off with some simple code to change our background colour.

body {
background-color:#FF9999
}     

Now  let’s get started on our containers. Containers can be used for organising your web page into different sections, or just for show.

body {
background-color:#FF9999
}     

.container {
width:860px;
min-height:400px; 
background-color:white;
margin:0 auto;
padding:20px;
}

Now we need to write some code into an HTML document so that the container will actually show up on our web page.

<body>

<div class="container"> 
</div>

</body>

Next time we will work on creating a header in our code.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s