Applying CSS

Site: ΕΛ/ΛΑΚ Moodle
Course: Study / Web Design and Web Development
Book: Applying CSS
Printed by: Guest user
Date: Saturday, 12 June 2021, 8:02 PM


  • Colors
  • Google fonts
  • Font Awesome
  • Box model


Colors are specified using:
  • color names
  • HEX (hexadecimal) values
  • RGBA values
  • and others

Have a look here

It's easy to find the color you want:

Have a look here

It's easy to detect a color:

Use the "Show Pixel Color" of your browser! Click here to install on Chrome or use the Web developer> Eyedropper tool of your Firefox.


What is the RGB value of this color?

Use Show Pixel Color


RGB (245, 130, 32)

Google fonts

Using Fonts we can achieve a unique look at our web pages.

There are lot available Fonts Libraries.

The most commonly used gallery is the Google Fonts.

It has a huge variety and detailed instructions on how to use it.


The CSS rules:

<!DOCTYPE html>
<html lang="en">
    <link href="" rel="stylesheet">
    <p style="font-family: 'Pacifico', cursive;" style = >Google Gonts</h3>

will create a page displayed as:

Google fonts


Icons is a very smart way to create visual contents without using images.

There are lot icon Libraries.

Here we will use the Font Awesome library. 

It is easy to insert Font Awesome icons into your code and there are detailed instructions for that.

To use the Font Awesome icons, add the following line inside the <head> section of your HTML page:

<link rel="stylesheet" href="">

Note, that you can change their color using the common CSS rules.


The CSS rules:

<!DOCTYPE html>
<html lang="en">
    <link rel="stylesheet" href="">
    <h3> <i class="fa fa-info-circle" aria-hidden="true"></i> Information icon</h3>

will create a page displayed as:

Font Awesome

For more information about icons:

Box model

With the term Box model we describe the surrounding area of every HTML element. 

You can imagine that as an invisible box where the elements are laying inside.

 Box Model

These "boxes" consists of four layers.

  • The first is the content. The content is the actual text or media that we have inside our element.
  • The second is the padding. Padding is the area around our content.
  • The third one, the border, surrounds both the padding area and the content. The border can be displayed on the page using the "border" CSS property and assign it values.
  • Lastly, we have the margin. Margin surrounds all the above and defines the distance from other element areas in our code.

The CSS rules:

<html lang="en">
      <title>Style - CSS</title>
           width: 33%;
           text-align: left;
           font-size: 0.75em;
           color: #006600;
           background: #fefecd;
           padding: 2%;
           margin: 0.75em;
           border-width: 10px;
           border-style: dotted;
           border-color: #900000;
      <h4>This is a Heading 4</h4>
      <p>This is lorem ipsum paragraph: <br>
           Lorem ipsum dolor sit amet, ea nec probo eloquentiam, in esse quando laboramus sea. <br>
           Ne omnesque detraxit eam, cu qui movet affert volutpat. <br>
           Qui amet option eu. Utamur euismod hendrerit vel no, ius natum salutatus forensibus in. <br>
           Sea diceret vivendo constituam at, duo an adhuc viderer evertitur.

will create a page displayed as:

Box model properties

For more information about the Box model:

For more information about the Borders:

For more information about the Margin:

For more information about the Padding: