-
Notifications
You must be signed in to change notification settings - Fork 0
Exercises (HTML): Webmaking with HTML and CSS
Jonathan edited this page Sep 15, 2023
·
6 revisions
-
Together: Review the text in the
body
element ofindex.html
. Decide on its structure in terms of headings, paragraphs, and lists. - Add HTML content elements
h1
,h2
,p
,ul
, andli
to the content, where appropriate. Try to add at least one of each element before repeating elements.
- Elements are made using tags, which are indicated by angle brackets, i.e.
<
and>
. - Element tags usually come in pairs, e.g.:
<h1>
and</h1>
.
<h1>Level 1 heading</h1>
<h2>Level 2 heading</h2>
<p>Paragraph or other text...</p>
<ul>
<li>First list item</li>
<li>Second list item</li>
</ul>
Inside the HTML elements from Exercise 1, add at least 6
elements of the following content elements:
<strong>
<em>
<mark>
<small>
Try to use at each element at least once!
- These elements will be nested within other content elements, e.g.:
<p>This is example text with <strong>some strongly emphasized words</strong>.</p>
Scroll down to the section titled, "Adding images". Find the image URLs/addresses provided. Hint: Look for text that starts with https://picsum.photos/seed …
- Create at least two image
img
elements from the URLs provided. Note: these can go anywhere but should not be inside a<p>
tag. - Anywhere in your project, convert some text to a link using the anchor
a
element. If you're not sure where to point it, you can usehttps://www.canadalearningcode.ca/
- Attribute values are usually surrounded by quotes (single
'
or double"
), e.g.src=" ... "
orhref=" ... "
- The image element tag
<img>
does not have a closing tag. - The text between an anchor element's start
<a>
and end</a>
tags becomes the clickable part of a link.
-
<img>
tag
<img src="https://picsum.photos/seed/qrst/800/250" alt="Photo of a black and white city skyline">
- anchor
a
element
<p>
Visit <a href="https://canadalearningcode.ca">Canada Learning Code's website</a>
to find out more about upcoming experiences!
</p>
-
Together: Examine the text (with content elements added) in the
body
and addheader
andmain
elements to it. - Examine the newly-created
main
element. Usingsection
elements, dividemain
into sections. Try to make at least3
sections.
- Look for patterns in the text.
- Try to create sections based on the presence of a short title followed by some other, longer content.
-
body
,header
andmain
<body>
<header>
<!-- Some header stuff here! -->
</header>
<main>
<!-- Main web page content in here -->
</main>
</body>
-
main
andsection
<main>
<section>
<!-- First section content -->
</section>
<section>
<!-- Second section content -->
</section>
<section>
<!-- Third section content -->
</section>
</main>