Course: Welcome

CSS Basics [8/14]

CSS is the language used to format the exterior of an HTML document. You can set the parameters of any tag rendering: width and height, padding, color and font size, background and etc.

CSS is an abbreviation of “Cascading Style Sheets”. Usually CSS is just called “styles”.

The easiest way to apply styles to a tag is to use the style attribute. For example:

<p style="color: red;">...</p>

In this example the paragraph is attributed red font color. This way of style setting is called “inline styles” or “built in styles”.

Syntax of such styles is simple: property: value;. And there can be several properties.

Now, let’s make a mini-summary of the course and highlight with green all the topics we have covered in practice. For this we will use inline styles.

Do it
<!DOCTYPE html> <html> <head> <title>CSS Basics</title> </head> <body> <h1>Course summary</h1> <p style="color: green;">Paired tags.</p> <p>Single tags.</p> <p>Tag attributes.</p> <p>Inline (built in) styles.</p> <p>Outer styles.</p> <p>Styling by class.</p> </body> </html>
/* This editor is inactive in this task. */
HTML Academy

Using the style attribute:

  1. Make font color of first three lines green,
  2. and of the last three – red.
Theory Check Next