-
Notifications
You must be signed in to change notification settings - Fork 0
LLC: Webmaking with HTML and CSS
Jonathan edited this page Jun 16, 2023
·
19 revisions
- Slides: https://bit.ly/llc-html2 (Google Slides)
- Learner reference: 👈 YOU ARE HERE
- Development environment & starter project: https://bit.ly/llc-html2-ide (CodeSandbox.io)
- HTML is made of elements.
- Elements are created using tags.
-
Tags use angle brackets, e.g.
<h1> ... </h1>and usually (though not always) come in pairs, which are put at the start and end of the content they contain<p> Content goes here </p>.- The start and end tags share the same element name however the end tag has a forward slash to distinguish it from the start tag, e.g.
<strong>and</strong>.
- The start and end tags share the same element name however the end tag has a forward slash to distinguish it from the start tag, e.g.
-
Most elements can (and often do) contain other elements, e.g. a
mainelement containing asectionelement:
<main>
<section>
Some section content here
</section>
</main><h1>Webpage title<h1>
<h2>Section 1 heading or title</h2>
<h3>Section 1 subheading A</h3>
<h3>Section 1 subheading B</h3>
<h2>Section 2 heading or title</h2>
<h3>Section 2 subheading A </h3>- 6 levels,
h1toh6. -
h1is the highest-level (most important) heading and there should only ever be one per page.
See the entry for unordered list and list items
<p> </p>- Despite its name, used to contain any amount of regular page text.
<ul>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>- Combination of
ulandlielements -
<ul> ... </ul>container for the items in the list. -
<li> ... </li>element for each list item. - Unordered list = bulleted list (a numbered list uses the ordered
olelement)
-
Some colours can be specified by name, e.g.,
background-color: red; -
Note that the color name is not enclosed in quotes, i.e., it is
redand not'red'. -
Select named colours, some of which are used in the starter project, include:
darkslategraygoldgoldenrodhotpinklightcyanlightgraylightgreenmediumvioletredskybluewhitewhitesmokeyellowgreen
-
A full list of named colours can be found in the MDN Web Docs References - <named-color> (External link)
MDN Web Docs References - rgb()
- Colours can be specified using an expression,
rgb( R, G, B)where each ofR,G, andBrefer to the amount of red, green, and blue present in a colour. -
R,G, andBcan be written in one of three ways:- as a
number, between0%and255. e.g.rgb(31 120 50)(dark green) - as a
percentage, between0and100%, e.g.rgb(30% 20% 50%)(purple) - using the keyword
none
- as a
- All of the values must be of the same type (i.e., all numbers or all percentages) or
none