HTML & CSS

HTML:

HTML is a markup language for describing web documents (web pages).

  • HTML stands for Hyper Text Markup Language
  • A markup language is a set of markup tags
  • HTML documents are described by HTML tags
  • Each HTML tag describes different document content

HTML Tags

HTML tags are keywords (tag names) surrounded by angle brackets:

<tagname>content</tagname>

  • HTML tags normally come in pairs like <p> and </p>
  • The first tag in a pair is the start tag, the second tag is the end tag
  • The end tag is written like the start tag, but with a slash before the tag name

Styling HTML with CSS

CSS stands for Cascading Style Sheets. Styling can be added to HTML elements in 3 ways:

  • Inline - using a style attribute in HTML elements
  • Internal - using a style element in the HTML head section
  • External - using one or more external CSS files

The most common way to add styling, is to keep the styles in separate CSS files.

CSS Syntax

CSS styling has the following syntax:

element { property:value; property:value }

The element is an HTML element name. The property is a CSS property. The value is a CSS value. Multiple styles are separated with semicolon.