Text Flashcards
What do we mean by semantic markup?
Adds meaning/extra information to an element
What do we mean by structural markup?
Adds structure to a page (paragraphs, headings)
Headings
<h1>-<h6>
To validate a page, you can't skip a heading level e.g. You can't have a page with H1 and H3 but no H2</h6></h1>
Paragrapghs
<p></p>
Bold
<b></b>
To be used just to differentiate text by bolding it. If you want to bold text to signify importance use strong</b>
italics
<i></i>
Use to display text in italics. If you want to emphasise text, use em</i>
superscript
Often used for mathematical formulas e.g</sup>
subscript
Often used for footnotes, chemical formulas e.g.</sub>
How is white space treated in html
It collapses.
If you have multiple white spaces in between words, they’ll get rolled into one. Similarly if you have multiple carriage returns between elements, they’ll get returned as just a single one
Line break
<br></br>
This is an empty element (i.e. no separate closing tag)
Horizontal rule
<hr></hr>
This is an empty element (i.e. no separate closing tag)
strong
<strong></strong>
Indicates element has extra importance.
Displays as bold</strong>
emphasis
<em></em>
Indicates emphasis the subtlety changes meaning.
Displays as italics</em>
blockquote
<blockquote>
Displays as indented
Also uses cite attribute which takes a url. The URL will provide additional information about the source.
Contents inside block quote should be put in a p tag
<blockquote><p>A long quote </p></blockquote></blockquote>
quote
Used for quotes in paragraphs.
Also uses cite attribute which takes a url. The URL will provide additional information about the source.