HTML

Computer Science: OCR A Level, topic 3.4.1

Hypertext Markup Language

Hypertext Markup Language (HTML) is a markup language used for the design of web pages. It specifies the structure of a webpage.

HTML introduction

HTML introduction

  • Most tags in html needs to come in a pair, one to open the element and one to close it:
  • <tag> ... </tag>
  • The <html> tag is used to enclose the entire page.
  • The <head> tag is used to enclose information about the page.
  • The <title> tag is used to define the title of the page.
  • The <body> tag is used to enclose the content of the page.
Basic page structure

Basic page structure

  • The layout used by any HTML page is shown in the image.
Common tags

Common tags

  • Headings can be created using tags <h1> through <h6>.
  • <h1> will create the largest heading, and <h6> will create the smallest.
  • Paragraphs can be created using <p> to enclose text.
  • Text can be made italic by enclosing in <i>.
  • Text can be made bold be enclosing in <b>.

Hypertext Markup Language

HTML has many tags, a few of which are shown here.

Structural tags

Structural tags

  • <center> can be used to center content on a page.
  • <blockquote> can be used to create an emphasised quote.
  • <hr> can be used to create a horizontal line across the page.
  • <img src="..."> can be used to display the image located at the src parameter.
Lists

Lists

  • <ul> will create an unordered list (bullet points).
  • <ol> will create an ordered list (numbers).
  • <li> will create an item within a list.
Links

Links

  • <a href="URL">Click Me</a> can be used to create a link.
  • The text displayed will be Click Me.
  • The link will take the user to the page at URL.
  • <a href="mailto:address"> can be used to send an email.
  • An email will be sent to address.

Test yourself on HTML

  • All HTML pages start with what tag?

  • Which of the following tags does not require a closing tag?

  • Which tag can create a horizontal rule?

  • Which tag is used to create a bullet-pointed list?

Practise this topic for free