CSS

CSS allows the styling of websites to make them look better and be more accessible and interesting to end users.

Key Points

CSS allows for websites to be styled.

To add style to an element, rules must be written.

Rules are made up of:

How to use CSS rules

Styles are applied to elements through the use of rules. Every rule is made up of three components:

  • Selector – How an element is told to look a certain way
  • Property – The part of the element that will be styled
  • Value – The value of the property that will be applied

The example below changes all heading 1’s to change their colour red:

  • h1 is the selector
  • color is the property
  • red is the value
Selector
Property
Value

Styling different HTML elements

Every HTML element can be styled in a variety of different ways. At National 5, there are a limited number of elements that you need to be able to apply styles.

Each HTML element has its own dedicated page with examples of CSS.

National 5 Targets

You should be able to implement CSS into your websites.

You should be able to identify the three parts of a CSS rule; selectors, properties and values.

You should be able to use and explain different selectors.

You should be able to explain and use Internal and External CSS.