-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
526 lines (473 loc) · 29.3 KB
/
index.html
File metadata and controls
526 lines (473 loc) · 29.3 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="index.css" type="text/css">
<link rel="icon" href="./images/favicon.ico" type="image/x-icon">
<title>HTML Cheat Sheet</title>
</head>
<body>
<header>
<h1>HTML Cheat Sheet</h1>
<nav>
<ul class="nav">
<li><a href="#html">HTML</a></li>
<li><a href="#page-tag">Page Tags</a></li>
<li><a href="#table-tag">Table Tags</a></li>
<li><a href="#layout-tag">Layout Tags</a></li>
<li><a href="#text-tag">Text Tags</a></li>
<li><a href="#list-tag">List Tags</a></li>
<li><a href="#media-tag">Media Tags</a></li>
<li><a href="#attributes">Attributes</a></li>
<li><a href="#links">Links</a></li>
<li><a href="#about">About me</a></li>
</ul>
</nav>
</header>
<main>
<h2 id="html">HTML</h2>
<p><strong>HTML</strong> (HyperText Markup Language) is used to give content to a web page and instructs
web browsers on how to structure that content.
</p>
<h3>HTML Tags</h3>
<p>HTML element (or simply, <strong>element</strong>) — a unit of content in an HTML document formed by HTML tags and the text or media it contains.
HTML Tag — the element name, surrounded by an opening (<) and closing (>) angle bracket.</p>
<div class="example">
<p class="teg"><strong><<span>h1</span>></strong> My
First Heading <strong><<span>h1</span>></strong></p>
</div>
<h3>HTML Structure</h3>
<p>HTML is organized as a collection of family tree relationships.
As you saw in the last exercise, we placed <strong><<span>h1</span>></strong>
tags within <strong><<span>body</span>></strong> tags. When an element is contained inside another element,
it is considered the child of that element. The child element is said to be nested inside of the parent element.
</p>
<div class="example">
<p><strong><<span>body</span>></strong><br></p>
<p class="teg"><strong><<span>h1</span>></strong> This header is a child of the body <strong><<span>h1</span>></strong><br></p>
<p><strong><<span>/body</span>></strong></p>
</div>
<h2 id="page-tag">HTML Page Tag Group</h2>
<p>The Page Tag Group is a group of tags that are used to define the structure of a web page. All web pages require a well-defined page structure
with a handful of foundational tags. This structure allows browsers to correctly process and render the pages.</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>!DOCTYPE html</span>></strong></td>
<td>Document Type Declaration</td>
<td>The document type declaration <strong><<span>!DOCTYPE html</span>></strong>
is required as the rst line of an HTML document. The doctype declaration is an instruction to the browser about what type of document
to expect and which version of HTML is being used, in this case it's HTML5.</td>
</tr>
<tr>
<td><strong><<span>html</span>></strong></td>
<td>HTML</td>
<td>The <strong><<span>html</span>></strong> element, the root of an HTML document, should be added after the
<strong>!DOCTYPE</strong> declaration. All content/structure for an HTML document should be contained between the
opening and closing <strong><<span>html</span>></strong> tags</td>
</tr>
<tr>
<td><strong><<span>head</span>></strong></td>
<td>Head</td>
<td>The <strong><<span>head</span>></strong> element contains general information about an HTML page that is not displayed on the page
itself. This information is called metadata and includes things like the title of the HTML document and links to stylesheets</td>
</tr>
<tr>
<td><strong><<span>meta</span>></strong></td>
<td>Metadata</td>
<td>The <strong><<span>meta</span>></strong> tag defines metadata about an HTML document. Metadata is data (information) about data.
<strong><<span>meta</span>></strong> tags always go inside the <strong><<span>head</span>></strong> element, and are typically
Metadata will not be displayed on the page, but is machine parsable.</td>
</tr>
<tr>
<td><strong><<span>link</span>></strong></td>
<td>link Tag</td>
<td>The <strong><<span>link</span>></strong> tag loads a linked resource into a page.
This tag is used to include a stylesheet or a favicon into a page.
Links are placed in the <strong><<span>head</span>></strong> section of the page.</td>
</tr>
<tr>
<td><strong><<span>title</span>></strong></td>
<td>Title</td>
<td>The <strong><<span>title</span>></strong> element contains a text that de nes the title of an HTML document.
The title is displayed in the browser's title bar or tab in which the HTML page is displayed. The <strong><<span>title</span>></strong>
element can only be contained inside a document's element</td>
</tr>
<tr>
<td><strong><<span>body</span>></strong></td>
<td>Body</td>
<td>The <strong><<span>body</span>></strong> element represents the content of an HTML document. Content inside
<strong><<span>body</span>></strong> tags are rendered on the web browsers.
There can be only one <strong><<span>body</span>></strong> element in a document.</td>
</tr>
<tr>
<td><strong><<span>!--...--</span>></strong></td>
<td>Comments</td>
<td>In HTML, comments can be added between an opening <strong><<span>!--</span></strong> and closing <strong><span>--</span>></strong>.
Content inside of comments will not be rendered by browsers. Comments can span single or multiple lines.</td>
</tr>
</tbody>
</table>
<h2 id="layout-tag">Layout Tag Group</h2>
<p>The Layout Tag Group is a group of tags that define document layouts. Most web pages require a layout with headers, columns, footers, and other sections.
This is similare to how a magazine or a newspaper page is organized. Layout tags define areas on a page that contain content.
Layout tags define areas on a page that contain content. By default these tags have no visual appearance, but they are often styled with a border or background color</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>header</span>></strong></td>
<td>Header</td>
<td>The <strong><<span>header</span>></strong> element represents a container for introductory content or a set of navigational links.
A <strong><<span>header</span>></strong> element typically contains one or more heading elements (<strong><<span>h1</span>></strong>
- <strong><<span>h6</span>></strong>), logo or icon or authorship information</td>
</tr>
<tr>
<td><strong><<span>main</span>></strong></td>
<td>Main</td>
<td>The <strong><<span>main</span>></strong> tag specifies the main content of a document. The content inside the
<strong><<span>main</span>></strong> element should be unique to the document. It should not contain any content that is repeated
across documents such as sidebars, navigation links, copyright information, site logos, and search forms. </td>
</tr>
<tr>
<td><strong><<span>footer</span>></strong></td>
<td>Footer</td>
<td>The <strong><<span>footer</span>></strong> tag defines a footer for a document or section.</td>
</tr>
<tr>
<td><strong><<span>nav</span>></strong></td>
<td>Navigation tag</td>
<td>The <strong><<span>nav</span>></strong> tag creates a container for navigation elements. It can hold navigation menus, quicklinks, table of contents, etc.</td>
</tr>
<tr>
<td><strong><<span>aside</span>></strong></td>
<td>Aside content</td>
<td>The <strong><<span>aside</span>></strong> tag defines some content aside from the content it is placed in. The aside content should be
indirectly related to the surrounding content.</td>
</tr>
<tr>
<td><strong><<span>article</span>></strong></td>
<td>Article</td>
<td>The <strong><<span>article</span>></strong> tag specifies independent, self-contained content. An article should make sense on its own
and it should be possible to distribute it independently from the rest of the site. It's used for blog posts, forums, newspaper articles, and more.
E-commerce articles include product descriptions, product cards, etc.</td>
</tr>
<tr>
<td><strong><<span>section</span>></strong></td>
<td>Section</td>
<td>The <strong><<span>section</span>></strong> tag defines a section in a document. The <strong><<span>section</span>></strong>
element contains stand-alone text or content. Of all semantic tags, <strong><<span>section</span>></strong> is the closest to a
<strong><<span>div</span>></strong>.</td>
</tr>
<tr>
<td><strong><<span>div</span>></strong></td>
<td>Division</td>
<td><strong><<span>div</span>></strong>s short for “division” or a container that divides the page into sections.</td>
</tr>
</tbody>
</table>
<h2 id="table-tag">Table Tag Group</h2>
<p>The Table Tag Group is a group of tags that are used to create HTML tables. HTML tables present tabular data.</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>table</span>></strong></td>
<td>Tabular display of data</td>
<td>The <strong><<span>table</span>></strong> tag creates an HTML table. A table is a tabular display of data, arranged in rows and columns.
Tables are highly configurable with captions, headers, footers, column and row spans, and more.</td>
</tr>
<tr>
<td><strong><<span>thead</span>></strong></td>
<td>Header of the table</td>
<td>The <strong><<span>thead</span>></strong> element is used in conjunction with the <strong><<span>tbody</span>></strong>
and <strong><<span>tfoot</span>></strong> elements to specify each part of a table (header, body, footer).</td>
</tr>
<tr>
<td><strong><<span>tbody</span>></strong></td>
<td>Table body content</td>
<td>The <strong><<span>tbody</span>></strong> tag is used to group the body content in an HTML table.
The <strong><<span>tbody</span>></strong> element is used in conjunction with the <strong><<span>thead</span>></strong> and
<strong><<span>tfoot</span>></strong> elements to specify each part of a table (body, header, footer). </td>
</tr>
<tr>
<td><strong><<span>tfoot</span>></strong></td>
<td>Table footer content</td>
<td>The <strong><<span>tfoot</span>></strong> tag is used to group footer content in an HTML table.
The <strong><<span>tfoot</span>></strong> element is used in conjunction with the <strong><<span>thead</span>></strong>
and <strong><<span>tbody</span>></strong> elements to specify each part of a table (footer, header, body).
</td>
</tr>
<tr>
<td><strong><<span>tr</span>></strong></td>
<td>Table row</td>
<td>The <strong><<span>tr</span>></strong> tag creates a table row in an HTML table. Each row is a container for one or more table cells.
A table can have any number of rows.</td>
</tr>
<tr>
<td><strong><<span>th</span>></strong></td>
<td>Table header cell</td>
<td>The <strong><<span>th</span>></strong> tag adds a table header cell to an HTML table. Each table header cell contains a title that
describes the data in the cells below.</td>
</tr>
<tr>
<td><strong><<span>td</span>></strong></td>
<td>Table data cell</td>
<td>The <strong><<span>td</span>></strong> tag adds a table cell to an HTML table. A table cell is a boxed area that displays a single data item</td>
</tr>
</tbody>
</table>
<h2 id="text-tag">Text Tag Group</h2>
<p>The Text Tag Group is a group of tags that are used to create well-formatted text documents. Tip: More recently, text formatting and styling has shifted from
HTML to CSS.</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>h1</span>></strong>...<strong><<span>h6</span>></strong></td>
<td>Headings</td>
<td>Headings in HTML are similar to headings in other types of media.</td>
</tr>
<tr>
<td><strong><<span>p</span>></strong></td>
<td>Paragraph</td>
<td>A paragraph is a distinct section of text with spacing before and after.</td>
</tr>
<tr>
<td><strong><<span>span</span>></strong></td>
<td>Span</td>
<td>The <strong><<span>span</span>></strong> tag is an inline container used to mark up a part of a text, or a part of a
document.</td>
</tr>
<tr>
<td><strong><<span>br</span>></strong></td>
<td>Line Breaks</td>
<td>The <strong><<span>br</span>></strong> tag in HTML document is used to create a line break in a text.</td>
</tr>
<tr>
<td><strong><<span>em</span>></strong></td>
<td>Emphasis Element</td>
<td>The <strong><<span>em</span>></strong> tag will generally render as <strong><em>italic</em></strong> emphasis.</td>
</tr>
<tr>
<td><strong><<span>strong</span>></strong></td>
<td>Bold text style</td>
<td>The <strong><<span>strong</span>></strong> will generally render as <strong>bold</strong> emphasis.</td>
</tr>
</tbody>
</table>
<h2 id="list-tag">List Tag Group</h2>
<p>The List Tag Group is a group of tags that are used to define lists of data items. A list is a sequential display of related items.
HTML supports 3 list types: unordered lists, ordered lists, and datalists. Each of these list types have their own tags.
</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>ul</span>></strong></td>
<td>Unordered Lists</td>
<td>An unordered list outlines individual list items with a <strong>bullet point</strong>.</td>
</tr>
<tr>
<td><strong><<span>ol</span>></strong></td>
<td>Ordered Lists</td>
<td>Ordered lists are like unordered lists (<strong><<span>ul</span>></strong>), except that each list item is <strong>numbered</strong>.</td>
</tr>
<tr>
<td><strong><<span>li</span>></strong></td>
<td>List</td>
<td>The <strong><<span>li</span>></strong> tag defines a list item. The <strong><<span>li</span>></strong> tag
is used inside ordered lists(<strong><<span>ol</span>></strong>), unordered lists (<strong><<span>ul</span>></strong>).</td>
</tr>
</tbody>
</table>
<h2 id="media-tag">Media Tag Group</h2>
<p>The Media Tag Group is a group of tags that help with creating multi-media experiences on a web page. With increasing bandwidths, multi-media is
becoming very important in web development. These include: images, animations, audio, and video.</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>audio</span>></strong></td>
<td>Audio</td>
<td>The <strong><<span>audio</span>></strong> element creates a player for sound such as music, sound effects, or others.</td>
</tr>
<tr>
<td><strong><<span>video</span>></strong></td>
<td>Video</td>
<td>The <strong><<span>video</span>></strong> element embeds a media player for video playback. The <strong>src</strong>
attribute will contain the URL to the video. Adding the
controls attribute will display video controls in the media player.</td>
</tr>
<tr>
<td><strong><<span>img</span>></strong></td>
<td>Image</td>
<td>HTML image <strong><<span>img</span>></strong> elements embed images in documents. The <strong>src</strong> attribute contains the image URL and is mandatory.
<strong><<span>img</span>></strong> is an empty element meaning it should not have a closing tag.</td>
</tr>
<tr>
<td><strong><<span>figure</span>></strong></td>
<td>Figure - embedded object</td>
<td>The <strong><<span>figure</span>></strong> tag creates a container that can embed any of the following: <strong>Images, Illustrations,
Infographics, Code Snippets</strong>, and others</td>
</tr>
<tr>
<td><strong><<span>figcaption</span>></strong></td>
<td>Figure caption</td>
<td>The <strong><<span>figcaption</span>></strong> tag adds a description to a <strong><<span>figure</span>></strong>.
Figure captions summarize or describe the figure or image.</td>
</tr>
</tbody>
</table>
<h2 id="attributes">HTML Attributes</h2>
<p>Attributes provide features or functionality to an element. Attributes are placed inside the element's opening tag. An element can have any number of attributes.</p>
<div class="example">
<p> <strong><<span>p</span> id=<span>"my-paragraph"</span> class=<span>"black"</span> style=
<span>"color: black;"</span>></strong> This example is a paragraph with 3 attributes: <strong>id</strong>, <strong>class</strong>, and <strong>style</strong>.
<strong><<span>/p</span>></strong></p>
</div>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><span>id</span></strong></td>
<td>Unique ID Attributes</td>
<td>In HTML, specific and unique <strong><span>id</span></strong> attributes can be assigned to different elements in order to differentiate between them.
When needed, the id value can be called upon by CSS and JavaScript to manipulate, format, and perform specific
instructions on that element and that element only. Valid <strong><span>id</span></strong> attributes should begin with a letter and should
only contain letters <strong>( a - Z )</strong>, digits <strong>( 0 - 9 )</strong>, hyphens <strong>( - )</strong>,
underscores <strong>( _ )</strong>, and periods <strong>( . )</strong>.</td>
</tr>
<tr>
<td><strong><span>alt</span></strong></td>
<td>alt Attribute</td>
<td>An <strong><<span>img</span>></strong> element can have alternative text via the <strong><span>alt</span></strong> attribute. The alternative text will be
displayed if an image fails to render due to an incorrect URL, if the image format is not supported by the browser, if the image is blocked from being displayed,
or if the image has not been received from the URL.</td>
</tr>
<tr>
<td><strong><span>href</span></strong></td>
<td>href Attribute</td>
<td>The <strong><span>href</span></strong> attribute defines a <strong>link address</strong> for an <strong><span>a</span></strong> tag.</td>
</tr>
<tr>
<td><strong><span>target</span></strong></td>
<td>Target Attribute</td>
<td>The <strong><span>target</span></strong> attribute on an <strong><<span>a</span>></strong> anchor element speci es where a hyperlink should be opened.
A <strong><span>target</span></strong> value of <strong>"_blank"</strong> will tell the browser to open the hyperlink in a new tab in modern browsers,
or in a new window in older browsers or if the browser has had settings changed to open hyperlinks in a new window.</td>
</tr>
<tr>
<td><strong><span>src</span></strong></td>
<td>src Attribute</td>
<td>The <strong><span>src</span></strong> attribute specifies the URL or path of the <strong>image</strong> to be displayed.</td>
</tr>
<tr>
<td><strong><span>lang</span></strong></td>
<td>lang Attribute</td>
<td>The <strong><<span>html</span>></strong> element has a <strong><span>lang</span></strong> attribute which specifies the document <strong>language</strong>.</td>
</tr>
</tbody>
</table>
<h2 id="links">HTML Links</h2>
<p>A link is an element that, when clicked, redirects the user to another web page. Links are usually text-based, but they can also be an image or otherwise.</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><<span>a</span>></strong></td>
<td>Anchor</td>
<td>The <strong><<span>a</span>></strong> anchor element is used to create hyperlinks in an HTML document. The
hyperlinks can point to other webpages,les on the same server, a location on the same page, or any other URL via
the hyperlink reference attribute, <strong>href</strong>. The <strong>href</strong> determines the location the anchor element points to.</td>
</tr>
</tbody>
</table>
<h3>Link to a Different Part of the Page #</h3>
<p>The anchor element <strong><<span>a</span>></strong> can create hyperlinks to different parts of the same HTML document using the
<strong><span>href</span></strong> attribute to point to the desired location with <strong>#</strong> followed by the <strong><span>id</span></strong>
of the element to link to.
</p>
<div class="example">
<p class="teg"><strong><<span>a</span> href=<span>"#bottom"</span>></strong>Take me to a bottom part of the
page<strong><<span>/a</span>></strong></p>
</div>
<div class="example">
<p><strong><<span>div</span>></strong><br></p>
<p class="teg"><strong><<span>p</span> id=<span>"bottom"</span>></strong>A
bottom part of the page!<strong><<span>/p</span>></strong><br></p>
<p><strong><<span>/div</span>></strong></p>
</div>
<h3>Creating text links</h3>
<p>
The <strong><<span>a</span>></strong> anchor element is used to create hyperlinks in an HTML document. The hyperlinks can point to other webpages,
les on the same server, a location on the same page, or any other URL via the hyperlink reference attribute, <strong>href</strong>.
The href determines the location the anchor element points to.
</p>
<div class="example">
<p class="teg"><strong><<span>a</span> href=<span>"https://developer.mozilla.org/en-US"</span>></strong>This site.<strong><<span>/a</span>></strong></p>
</div>
<h3>Creating image links</h3>
<p>Images can also be used as links.</p>
<div class="example">
<p class="teg"><strong><<span>a</span> href=<span>"https://www.codecademy.com"</span>><<span>img</span> src=<span>"logo.jpg"</span>></strong>Click this image.<strong><<span>/a</span>></strong></p>
</div>
</main>
<footer id="about">
<img id="avatar" src="./images/mTapirina-ava.png" alt="my-img">
<p class="ava">About me:
<a href="https://www.behance.net/mtapirina" title="Creative Artist - Designer" target="_blank">Behance Portfolio Maria M. Tapirina</a></p>
</footer>
</body>
</html>