<html>
<head>
<h1>Page 1</h1>
</head>
<body>
<title>Badminton!</title>
<paragraph>
Badminton is an old sport, originating in France.
Originally only played by wealthy landowners
it eventually made it into mainstream sport.
</paragraph>
<paragraph>
This website is all about badminton.
<paragraph>
</body>
</html>
<html>
<head>
<h1>Page 1</h1>
</head>
<body>
<title>Badminton!</title>
<paragraph>
Badminton is an old sport, originating in France.
Originally only played by wealthy landowners
it eventually made it into mainstream sport.
</paragraph>
<paragraph>
This website is all about badminton.
<paragraph>
</body>
</html>
To write HTML – the code needed to make websites
Understand why we use HTML
Be able to use semantic elements within a webpage
HTML or Hyper Text Mark-up Language, is a coding language that is used to develop webpages.
HTML deals with the content that we put in our pages but doesn’t deal with the appearance of the content.
HTML is made up of elements. Each element consists of tags, attributes and content.
Pages are made up of tags:
Image copyright jamiebalfour.scot
An attribute (such as src) gives the browser additional information about how to display a tag.
For example:
<img src="image1.jpg" alt="Me">
A web page has a very simple structure
<!doctype html>
<html>
<head>
<title>Sample page</title>
</head>
<body>
<p>
Hello class
</p>
</body>
</html>
The <!doctype html> tells the browser viewing the page to treat the page as HTML
A web page has a very simple structure
<!doctype html>
<html>
<head>
<title>Sample page</title>
</head>
<body>
<p>
Hello class
</p>
</body>
</html>
The <!doctype html> tells the browser viewing the page to treat the page as HTML
A web page has a very simple structure
<!doctype html>
<html>
<head>
<title>Sample page</title>
</head>
<body>
<p>
Hello class
</p>
</body>
</html>
A web page has a very simple structure
There should only be one head tag and one body tag
html
element is the first element you need to add to the page.<html></html>
tags).The head
element contains information about the page, including the title, any linked CSS (more later) or JavaScript (more later).
Anything that appears in the head tag is not guaranteed to display on all browsers (some browsers do display certain tags from it but others display zilch)
The information stored in the head
element is often referred to as meta data.
Such information that might be found in the head tag is things like the page title, any keywords used on the page, links to any CSS pages or JavaScript scripts, locations of assets such as favicons etc or the author of the page.
The body
element contains the content of the page. It must come after the closing head tag.
The body tag is where all content should go.
In the body tag you will find all sorts of content such as paragraphs of text, images links etc.
It's important to follow the rules when working with HTML.
All tags must be closed. There are some self-closing tags such as the <img> tag which we will look at later that do not need closed manually. Tip: when creating a new tag, create the closing tag immediately after creating the opening tag
Anything in the <head> is not guaranteed to display on all browsers, anything you want to display on the webpage should go in the <body> tag.
You should only have one <head> and one <body> tag on a webpage, otherwise the browser might ignore the second tag.
Check your webpages regularly and use the validator to ensure your page is correctly written
Answer each of the following questions:
DEMO
<a href="page2.html">To another page</a>
<ul>
<li>List item 1</li>
<li>List item 2</li>
</ul>
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
<img src="cat.png" alt="Cat">
<img src="https://cdn.pixabay.com/photo/2014/06/21/08/43/rabbit-373691_1280.jpg" alt="Cat">
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<audio width="500" controls>
<source src="music1.mp3" type="audio/mpeg">
<source src="music1.wav" type="audio/wav">
</audio>
<video width="500" controls>
<source src="hare.mp4" type="video/mp4">
<source src="hare.webm" type="video/webm">
</video>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
Write the HTML for each of the following:
Higher HTML
<nav>
tag is used to contain information about website or page navigation. <nav>
element surrounds the main menubar or webpage navigation (like Wikipedia has)<header>
tag often contains what is called the masthead of the webpage.<header>
may contain a logo or text that takes the user back to the main page via a hyperlink, as well as a title and potentially a site-wide search box.<footer>
tag is used to contain site links and legal information (such as copyright information). <main>
tag is usually the main content of the page. <main>
tag is often composed of <section>
tags. <section>
tags help break up the material or content of the page.<section>
tags and expects you to style them further.HTML 5 elements have been used to define different parts of the page shown below.
State which elements have been used for the parts labelled A and B.
A _________________________________________
B _________________________________________
2 marks
2019 Q9
<nav>
<footer>
<form>
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="Login">
</form>
The SQA is using the wrong terminology when working with this stuff so you might find conflicting information online.
<input>
element is used to take a single piece of data from the user. <input>
.<input>
element by default accepts text:<input type="text" name="username" size="40">
size="40"
sets the width of the input box in characters.<input>
element can also be set to accept numeric values only. <input type="number" name="count" min="0" max="10">
<input>
element can be styled as a radio button<p>Would you like salad with your order?</p>
<label><input type="radio" name="salad" value="1">Yes</label>
<label><input type="radio" name="salad" value="0">No</label>
<textarea>
element is designed for collecting larger amounts of data.<input>
tag, it is not self-closing.<textarea name="order">Please insert your order here</textarea>
<input>
tag and give it a type attribute of submit:<input type="submit" value="Send data">
<select>
element alongside the <option>
element.<form>
Select city:
<select name="city">
<option value="Aberdeen">Aberdeen</option>
<option value="Dundee">Dundee</option>
<option value="Edinburgh">Edinburgh</option>
<option value="Glasgow">Glasgow</option>
<option value="Inverness">Inverness</option>
<option value="Perth">Perth</option>
<option value="Stirling">Stirling</option>
</select>
</form>
<form>
Select city:
<select name="city">
<option value="Aberdeen">Aberdeen</option>
<option value="Dundee">Dundee</option>
<option value="Edinburgh">Edinburgh</option>
<option value="Glasgow">Glasgow</option>
<option value="Inverness">Inverness</option>
<option value="Perth">Perth</option>
<option value="Stirling">Stirling</option>
</select>
</form>
<form>
Select city:
<select multiple name="city">
<option value="Aberdeen">Aberdeen</option>
<option value="Dundee">Dundee</option>
<option value="Edinburgh">Edinburgh</option>
<option value="Glasgow">Glasgow</option>
<option value="Inverness">Inverness</option>
<option value="Perth">Perth</option>
<option value="Stirling">Stirling</option>
</select>
</form>
<form>
Select city:
<select multiple name="city">
<option value="Aberdeen">Aberdeen</option>
<option value="Dundee">Dundee</option>
<option value="Edinburgh">Edinburgh</option>
<option value="Glasgow">Glasgow</option>
<option value="Inverness">Inverness</option>
<option value="Perth">Perth</option>
<option value="Stirling">Stirling</option>
</select>
</form>
The SQA sometimes refers to a list like this with multiple selections as a dropdown list. This is incorrect but know that they are asking about lists like this!
<form>
<p>
Welcome to the sign up form for Loch Tay Adventure Park!
</p>
<label>
Name
<input type="text" name="name">
</label><br>
<label>
Number of guests
<input type="number" name="number_of_guests" min="1" max="10">
</label><br>
<label>
Why Loch Tay? <textarea name="explanation">I love...</textarea>
</label>
<input type="submit">
</form>
<input type="number" name="count" min="0" max="10">
<input type="text" required>
<input type="text" maxlength="30">
<select>
box as this only allows the user to pick from the selection.<select name="sport">
<option value="Basketball">Basketball</option>
<option value="Football">Football</option>
<option value="Volleyball">Volleyball</option>
</select>
The HTML code for a form is shown below.
(i) Identify two types of validation used in the form code.
Type 1 _________________________________________
Type 2 _________________________________________
2 marks
(ii) State the number of property types that a seller can select.
_______________________________________________
1 mark
1
Presence
Restricted choice
First of all, read through the notes at HIGHERFORMSBITESIZE
Complete the worksheet by building forms that meet the specifications.
The following are key shortcuts for using DragonSlides and reveal.js.
Key combination | Action |
---|---|
→, PAGE DOWN, SPACE | Next slide |
←, PAGE UP | Previous slide |
SHIFT + → | Last Slide |
SHIFT + ← | First slide |
B | Whiteboard |
W | Widget Board/White Screen |
C | Toggle Notes Canvas |
DEL | Clears Whiteboard/Notes Canvas |
S | Show Presenter Mode |
SHIFT + D | Toggle Dark Mode |
H | Goes to the Home Slide |
META + P | Show Print options window |
In order to use the 'Start Remote' feature, you'll need to download JB Slide Controls from the Apple App Store. Once you have this you'll be able to control the slides using the app from you Apple Watch.
DragonSlides and jamiebalfour.scot are copyright © Jamie B Balfour 2017 - 2024, 2010 - 2024. Content is copyright © Jamie B Balfour