HTML Course Notes
HTML Course Notes
Module 1
Syntax
DOM Tree
The DOM tree comes into play if you write CSS or JavaScript, or when your
developers do. The browser then uses the DOM
Use Codepen.io
Headlines
There are from h1 to H6. Each one has hirarcy and font size
<i> visual-only italics
<em> emphasis italics
Like <p> my <em> favorite </em> character from <i> sesame street </i> is Grover. </p>
Favorite streeting the meaning using <em> while seasom sttree <i> for name show
Lists
- Unordered lists
- Ordered lists
- Definition lists
Quota
<blockquota>
<p> …… </p>
Or
<p>
<q> </q> in to the text …. </p>
If you want to highlight a short quote, <q> is great to use inside of a paragraph or other block-level element.
<blockquote> is for when you want something bigger, to really stand out.
Codes:
<p>
We can write <code> {color:green;} </code> in our CSS, and it will apply to anything
marked up as an H4 element
<code>
</p>
Html entities when type < will get < sign when type > will get > bigger than sign
Breaks
Subscripts : characters that are set below the text baseline like 2 in h2o.
<p>H<sub>2</sub>O</p>
Superscripts like in mathematical formulas 5 2 =5 square <p>5<sup>2</sup></p>
Using the developer tool to unders the codes and debug errors
Global attributes :
attributes that can be applied to any HTML element
the class attribute: allow us to target all elements with that class in our CSS or javascript
<p class+”into>
This is the introduction.
</p>
Id is another popular one, it's similar to class but we're only allowed to use
unique names once in an entire HTML page. You can use an ID for targeting
CSS, but it's much more specific and that can be a problem.
<p class+”into” id+article-intro”> this is the introduction.
</p>
ARIA roles
Another type of attibutes
Html attributes that provide accessible information about that specific element
Formatting HTML
Add comments to code by typing less than,
<!—this is a comment that will be totally ignored
-->
Weird characters
Entity. Character
< <
> >
Amp; &
© cin circle
&trade. Tm
☆ star
Relative URL
Absolute URL
Whena website might be moved from a staging server to a production server
Navigation
<nav role=”navigation” aria-label+”main”>
<ul class+”navbar”>
<li><a href=”/”>home</a></li>
<li><a href=”/people”>people</a></li>
…..
</ul>
Or
<nav aria-label=”breadcrumb”>
<ol class=”breadcrumbs”>
<li><a href=”/”>home</a></li>
…..
…..
</ol>
</nav>
Or <footer>
</footer>
IMages
<img>
It attrbutes four
The source attribute shortned to SRC
<img src=”image.jpg”>
The alt attribute, ALT
<img src=”image.jpg”> alt=”black dog”> width=”400” height=”300”>
Image format
GIF
SVG – logos icons, etc it is vector
Jpg
Png
Srcset=”https://............2x,
Htttps://…… 3x,
………..4x”
To consider the width of viewport based on the size of the screen as well density
Use 480w = 480 px wide
960…
<picture>
<source media=”(min-width:600px)”
MEDIA
Audio
<audio> controls src=”audio.mp3” loop autoplay> </audio>
Different formats
h.264 codec currently has the widest support across the browsers looks like av1
Embedding
Like maps toolkit
Youtube
<iframe>
Identity content
Lang=”en-us”
The lang attributs:
Language
Script
Alphabet
The charset attribute : it defines the alphabet or set of characters for the script language
url
html file
- the head element to info the broswesr needs to know and it won’t be displayed on the
page
- Structuring content
Main
Header
Footer
Article
Section
Aside
Date
Color
File
Checkbox
Dropdown list
<fieldset>
Tabular data
<table>
Tr for table row
Th table header
Td for table data