Company logo
html logo
Back
Next

L e t ' s a d d s o m e c o l o u r !

So you've learnt a bit about the structure of HTML and how it can be used to create content on a webpage. But HTML on its own isn't enough to create the beautiful websites that we're all used to seeing.

To add some colour we'll need to use cascading style sheets (CSS)

CSS is used to style the content on a webpage. It can be used to change the colour, size, font and layout of elements on a page, and much more.

Take a look at the below example of some CSS:

Notice how the <style> element goes inside the <head> element, below the <title> element. This is where you will put your CSS code.

The example on the right is what the CSS code on the left will create

Let's break it down: You can see that we are targeting HTML elements in our CSS (body, h2, etc.) then in curly braces we have what we want to change (background, font-family, etc.) and then a colon and the value we want to change it to (orange, verdana, etc.).

simple html code
simple html code

Please forgive the American spelling of colour! this is something the world just has to live with.

As with most things, the best way to learn to code is to try for yourself!

Start Coding!