forked from getty-code-camp/session-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-basics.html
91 lines (91 loc) · 2.89 KB
/
html-basics.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Text Elements</title>
</head>
<body>
<h1>Text elements</h1>
<h2>The web is mostly text, so start with these!</h2>
<hr />
<h2>Heading Elements</h2>
<p>HTML supports six levels of headings:</p>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<br />
<h2>Body Text</h2>
<p>
This is the humble paragraph tag, possibly the element you will encounter
the most.
</p>
<p>
Paragraph text, like headings, is a <strong>block-level</strong> element.
Typically these elements will expand to fill all available space.
</p>
<p>
There is another category of elements, called <strong>inline</strong>
elements. The bold text you see here is one example, it's generated by
a <strong> tag.
</p>
<p>
How to you write the name of a tag instead of creating the tag in place?
HTML allows you to use a special code starting with the & character to
display these characters literally. Take a look at the source code of this
page to see how it's done.
</p>
<p>
Common inline values include:
<ul>
<li><strong>: <strong>for bold text</strong></li>
<li><em>: <em>for emphasis</em></li>
<li><span>: <span>Span tags for arbitrary snippets</span></li>
<li>
<sup> and <sub> for <sup>superscript</sup> and
<sub>subscript</sub>, respectively.
</li>
<li>There are
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements">
Many more!
</a>
</li>
</ul>
</p>
<p>
As you may have noticed by now, elements (both span and block) can appear
nested inside one another. The paragraph above has a list element inside
of it — this is totally fine!
</p>
<br />
<h2>List elements</h2>
<p>Speaking of lists, here are a few examples:</p>
<h3>Ordered Lists</h3>
<ol>
<li>Use these when you need numbers, or when order is meaningful</li>
<li>You can create this using the <ol> tag.</li>
<li>Inside should go one or more list items (<li> tags).</li>
</ol>
<h3>Unordered lists</h3>
<ul>
<li>
Use an unordered list when you don't want numbers, or when order is not
as meaningful.
</li>
<li>You use the <ul> tag to create these elements.</li>
<li>
Unordered lists are often used in many other contexts as well, like
in a site's navigational menus.
</li>
</ul>
<h3>Definition Lists</h3>
<dl>
<dt><dt> Tag</dt>
<dd>
Represents a definition; this <dd> tag represents its description.
</dd>
</dl>
</body>
</html>