-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocs.html
More file actions
1126 lines (902 loc) · 47 KB
/
docs.html
File metadata and controls
1126 lines (902 loc) · 47 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
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Documentation for GDCSS</title>
<link rel="stylesheet" href="/gd.css">
<meta name="theme-color" content="#0b0c0c">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" sizes="16x16 32x32 48x48 128x128 256x256 512x512" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="favicon.icns">
<meta name="og:title" content="GDCSS Documentation">
<meta name="description" content="Documentation for using GDCSS HTML5 CSS reset.">
<meta name="og:description" content="Documentation for using GDCSS HTML5 CSS reset.">
</head>
<body>
<a href="#main-content" class="hide">Skip to main content</a>
<a name="top"></a>
<header>
<nav>
<a href="/"><img alt="Logo" src="/demo/logo.svg" width="280"></a>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/docs.html">Documentation</a></li>
<li><a href="/gd.css">Download</a></li>
</ul>
</nav>
</header>
<nav>
<ol>
<li><a href="/">Home</a></li>
<li><a href="/docs.html">Documentation</a></li>
</ol>
</nav>
<main id="main-content">
<h1>Documentation</h1>
<p>A good test of this stylesheet is to try out all of the tags. Here is the tag reference from Mozilla with demo
code and examples of how each tag is styled.</p>
<p>There are also <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/var()">CSS variables</a> for the main
colours, so if you need to retheme the colour scheme you can!</p>
<h2>Head, body, meta code</h2>
<p>Metadata contains information about the page. This includes information about styles, scripts and data to help
software (search engines, browsers, etc.) use and render the page. Metadata for styles and scripts may be defined in
the page or link to another file that has the information.</p>
<p><var><html></var>The HTML element represents the root (top-level element) of an HTML document, so it is also
referred to as the root element. All other elements must be descendants of this element.</p>
<p><var><base></var> elements specify the base URL to use for all relative
URLs in a document.</p>
<p><var><head></var> elements contains machine-readable information (metadata)
about the document, like its title, scripts, and style sheets.</p>
<p><var><link></var> The HTML External Resource Link element specifies relationships
between the current document and an external resource. This element is most commonly used to link to stylesheets, but
is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile
devices) among other things.</p>
<p><var><style></var> elements contain style information for a document, or part of a document.</p>
<p><var><title></var> defines the document's title that is shown in a browser's title bar or a page's tab.</p>
<p><var><meta></var> elements represent metadata that cannot be represented by
other HTML meta-related elements, like <var><base></var>, <var><link></var>, <var><script></var>,
<var><style></var> or <var><title></var>.</p>
<p><var><body></var> element represents the content of an HTML document. There can be only one in a document.</p>
<h4>Demo</h4>
<p>You're already seeing it, but a lot of the head / meta content isn't visible directly...</p>
<details>
<summary>View example source</summary>
<pre><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>GDCSS Documentation</title>
<meta name="description" content="Documentation for a tags-only CSS library" />
<meta name="author" content="Stephen Hawkes" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<link href="gd.css" rel="stylesheet">
</head></pre>
</details>
<hr />
<h2>Content sectioning</h2>
<p>Content sectioning elements allow you to organize the document content into logical pieces. Use the sectioning
elements to create a broad outline for your page content, including header and footer navigation, and heading
elements to identify sections of content.</p>
<h3>Layout</h3>
<p>Really HTML is about semantics, but these particular tags have been styled in so that they also produce common layout patterns.</p>
<p><var><article></var> elements represent a self-contained composition in
a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in
syndication).</p>
<p><var><aside></var> elements represents a portion of a document whose
content is only indirectly related to the document's main content.</p>
<p><var><footer></var> elements represents a footer for its nearest
sectioning content or sectioning root element. A footer typically contains information about the author of the
section, copyright data or links to related documents.</p>
<p><var><header></var> elements represent introductory content, typically a
group of introductory or navigational aids. It may contain some heading elements but also a logo, a search form, an
author name, and other elements.</p>
<p><var><main></var> elements represent the dominant content of the
<var><body></var> of a document. The main content area consists of content that is directly related to or
expands upon the central topic of a document, or the central functionality of an application.</p>
<p><var><nav></var> elements represent a section of a page whose purpose is to
provide navigation links, either within the current document or to other documents. Common examples of navigation
sections are menus, tables of contents, and indexes.</p>
<h4>Demo</h4>
<iframe src="/demo/iframe.html"></iframe>
<details>
<summary>View example source</summary>
<pre><body>
<header>
Body > HEADER
<nav>Header nav</nav>
</header>
<nav>Body NAV</nav>
<main>
<header>Body HEADER</header>
Body
<section>
<article>ARTICLE</article>
<aside>ASIDE</aside>
</section>
</main>
<footer>
Footer
<main>Footer MAIN</main>
</footer>
</body></pre>
</details>
<hr />
<p><var><section></var> elements represents a standalone section
— which doesn't have a more specific semantic element to represent it — contained within an HTML
document. We use this to denote subdivisions or 'sections' as a way to create extra layouts without messing up semantics. In short, this tag just creates a CSS grid layout for child elements.</p>
<h4>Demo</h4>
<section>
<aside>
<p>Aside 1</p>
</aside>
<aside>
<p>Aside 2</p>
</aside>
<aside>
<p>Aside 3</p>
</aside>
</section>
<details>
<summary>View example source</summary>
<pre><section>
<aside>
<p>Aside 1</p>
</aside>
<aside>
<p>Aside 2</p>
</aside>
<aside>
<p>Aside 3</p>
</aside>
</section></pre>
</details>
<hr />
<h3>Headings</h3>
<p><var><h1></var>, <var><h2></var>, <var><h3></var>, <var><h4></var>, <var><h5></var>,
<var><h6></var> The HTML <var><h1></var>–<var><h6></var> elements represent six levels of
section headings. <var><h1></var> is the highest section level and <var><h6></var> is the lowest.</p>
<h4>Demo</h4>
<details>
<summary>View demo</summary>
<h1>Heading One</h1>
<h2>Heading Two</h2>
<h3>Heading Three</h3>
<h4>Heading Four</h4>
<h5>Heading Five</h5>
<h6>Heading Six</h6>
</details>
<details>
<summary>View example source</summary>
<pre><h1>Heading One</h1>
<h2>Heading Two</h2>
<h3>Heading Three</h3>
<h4>Heading Four</h4>
<h5>Heading Five</h5>
<h6>Heading Six</h6></pre>
</details>
<hr />
<p><var><hgroup></var> elements represent a multi-level heading for a
section of a document. It groups a set of <var><h1></var>–<var><h6></var> elements. We use this grouping to show the combination style variants of the headers.</p>
<h4>Demo</h4>
<hgroup>
<h4>Some title smaller</h4>
<h1>Big heading</h1>
</hgroup>
<details>
<summary>View example source</summary>
<pre><hgroup>
<h4>Some title smaller</h4>
<h1>Big heading</h1>
</hgroup></pre>
</details>
<hr />
<h2>Text content</h2>
<p>Use HTML text content elements to organize blocks or sections of content placed between the opening
<var><body></var> and closing <var></body></var> tags. Important for accessibility and SEO, these
elements identify the purpose or structure of that content.</p>
<p><var><address></var> elements indicate that the enclosed HTML provides
contact information for a person or people, or for an organisation.</p>
<h4>Demo</h4>
<address>
Steve Hawkes<br />
<a href="mailto:steve@dev.ngo">steve@dev.ngo</a><br>
<a href="tel:+443333447800">+44 (0) 333 344 7800</a>
</address>
<details>
<summary>View example source</summary>
<pre><address>
Steve Hawkes<br />
<a href="mailto:steve@dev.ngo">steve@dev.ngo</a><br>
<a href="tel:+443333447800">+44 (0) 333 344 7800</a>
</address></pre>
</details>
<hr />
<p><var><blockquote></var> elements (or Block Quotation Element)
indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see
Notes for how to change it). A URL for the source of the quotation may be given using the cite attribute, while a
text representation of the source can be given using the <var><cite></var> element.</p>
<p><var><q></var> elements indicate that the enclosed text is a short inline
quotation. Most modern browsers implement this by surrounding the text in quotation marks.</p>
<p><var><cite></var> The HTML Citation element is used to describe a reference to a
cited creative work, and must include the title of that work.</p>
<h4>Demo</h4>
<blockquote cite="https://design-system.service.gov.uk/styles/">
<q>Make your service look and feel like GOV.UK.</q>
<cite>GOV.UK Design System team</cite>
</blockquote>
<details>
<summary>View example source</summary>
<pre><blockquote cite="https://design-system.service.gov.uk/styles/">
<q>Make your service look and feel like GOV.UK.</q>
<cite>GOV.UK Design System team</cite>
</blockquote></pre>
</details>
<hr />
<h3>Containers for styling</h3>
<p><var><div></var> The HTML Content Division element is the generic container for
flow content. It has no effect on the content or layout until styled using CSS. They do nothing in GDCSS, because they don't carry any meaning. They can be useful in combination with <var><section></var> tags to manage the CSS grid.</p>
<p><var><span></var> elements are a generic inline container for phrasing
content, which does not inherently represent anything. It can be used to group elements for styling purposes (using
the class or id attributes), or because they share attribute values, such as lang.</p>
<hr />
<p><var><dl></var> elements represent a description list. The element encloses a
list of groups of terms and descriptions. Common uses for this element are to implement a glossary
or to display metadata (a list of key-value pairs).</p>
<p><var><dt></var> elements specify a term in a description or definition list.</p>
<p><var><dd></var> elements provide the description, definition, or value for
the preceding term in a description list.</p>
<h4>Demo</h4>
<dl>
<dt>Definition term 1</dt>
<dd>Definition description 1</dd>
<dt>Definition term 2</dt>
<dd>Definition description 2</dd>
<dt>Definition term 3</dt>
<dd>Definition description 3</dd>
</dl>
<details>
<summary>View example source</summary>
<pre><dl>
<dt>Definition term 1</dt>
<dd>Definition description 1</dd>
<dt>Definition term 2</dt>
<dd>Definition description 2</dd>
<dt>Definition term 3</dt>
<dd>Definition description 3</dd>
</dl></pre>
</details>
<hr />
<p><var><figure></var> (Figure With Optional Caption) element represents
self-contained content, potentially with an optional caption.</p>
<p><var><figcaption></var> or Figure Caption element represents a
caption or legend describing the rest of the contents of its parent <var><figure></var> element.</p>
<h4>Demo</h4>
<figure>
<img src="https://via.placeholder.com/960x320" alt="The figure tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.">
<figcaption>The figcaption tag defines a caption for a figure element.</figcaption>
</figure>
<details>
<summary>View example source</summary>
<pre><figure>
<img src="https://via.placeholder.com/960x320" alt="The figure tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.">
<figcaption>The figcaption tag defines a caption for a figure element.</figcaption>
</figure></pre>
</details>
<hr />
<p><var><hr></var> elements represent a thematic break between paragraph-level
elements: for example, a change of scene in a story, or a shift of topic within a section. You can see them between each area on this page.</p>
<details>
<summary>View example source</summary>
<pre><hr /></pre>
</details>
<hr />
<p><var><ul></var> elements represent an unordered list of items, typically rendered as a bulleted list.</p>
<p><var><ol></var> elements represent an ordered list of items — typically rendered as a numbered list.</p>
<p><var><li></var> elements is used to represent an item, normally in an ordered or unordered list.</p>
<h4>Demo</h4>
<ul>
<li>unordered one</li>
<li>unordered one</li>
</ul>
<ol>
<li>ordered one</li>
<li>ordered two</li>
</ol>
<details>
<summary>View example source</summary>
<pre><ul>
<li>unordered one</li>
<li>unordered one</li>
</ul>
<ol>
<li>ordered one</li>
<li>ordered two</li>
</ol></pre>
</details>
<hr />
<p><var><p></var> elements represent a paragraph. This line of text is in a paragraph.</p>
<details>
<summary>View example source</summary>
<pre><p>Some text and inline elements here.</p></pre>
</details>
<hr />
<p><var><pre></var> elements represents preformatted text which is to be
presented exactly as written in the HTML file.</p>
<h4>Demo</h4>
<pre>Some text where
the indentation
matters
to and isn't altered by the browser...</pre>
<details>
<summary>View example source</summary>
<pre><pre>Some text where
the indentation
matters
to and isn't altered by the browser...</pre></pre>
</details>
<hr />
<h2>Inline text semantics</h2>
<p>Use the HTML inline text semantic to define the meaning, structure, or style of a word, line, or any arbitrary
piece of text.</p>
<p><var><a></var> elements (or anchor element), with its href attribute, creates a
hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.</p>
<h4>Demo</h4>
<p>We see these a lot on, here is your <a href="#">common link</a>, standard variety. To make things more fun, we also added some extra cases based on how you use them: <a href="https://gov.uk/">External links</a>, <a href="javascript:history.back()">Back
links</a>, and <a href="#top">Top links</a> for common icon inclusion.</p>
<details>
<summary>View example source</summary>
<pre><p>We see these a lot on, here is your <a href="#">common link</a>, standard variety. To make things more fun, we also added some extra cases based on how you use them: <a href="https://gov.uk/">External links</a>, <a href="javascript:history.back()">Back links</a>, and <a href="#top">Top links</a> for common icon inclusion.</p></pre>
</details>
<hr />
<h3>Emphasis</h3>
<p><var><b></var> The HTML Bring Attention To element is used to draw the reader's
attention to the element's contents, which are not otherwise granted special importance.</p>
<p><var><strong></var> The HTML Strong Importance Element indicates that its
contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.</p>
<p><var><em></var> elements mark text that has stress emphasis. It can be nested,
with each level of nesting indicating a greater degree of emphasis.</p>
<p><var><i></var> elements represent a range of text that is set off from the
normal text for some reason.</p>
<h4>Demo</h4>
<p>There's lots of ways to show emphasis with <b>bold</b>, <strong>strong</strong> tags varying weight and <em>em</em> and <i>italics</i> for text styles.</p>
<details>
<summary>View example source</summary>
<pre><p>There's lots of ways to show emphasis with <b>bold</b>, <strong>strong</strong> tags varying weight and <em>em</em> and <i>italics</i> for text styles.</p></pre>
</details>
<hr />
<h3>Code and outputs</h3>
<p><var><code></var> elements display its contents styled in a fashion
intended to indicate that the text is a short fragment of computer code.</p>
<p><var><kbd></var> The HTML Keyboard Input element represents a span of inline text
denoting textual user input from a keyboard, voice input, or any other text entry device.</p>
<p><var><mark></var> The HTML Mark Text element represents text which is marked or
highlighted for reference or notation purposes, due to the marked passage's relevance or
importance in the enclosing context.</p>
<p><var><var></var> The HTML Variable element represents the name of a variable in a
mathematical expression or a programming context.</p>
<p><var><samp></var> The HTML Sample Element is used to enclose inline text which
represents sample (or quoted) output from a computer program.</p>
<p><var><data></var> elements link a given content with a machine-readable
translation. If the content is time- or date-related, the <var><time></var> element must be used.
Nothing visible, but adds semantic expression.</p>
<p><var><time></var> elements represent a specific period in time. Nothing visible, but adds semantic expression.</p>
<h4>Demo</h4>
<p><code>Code here</code><br />
<kbd>kbd here</kbd><br />
<mark>mark here</mark><br />
<var>Var here</var><br />
<samp>Samp here</samp><br />
<data value="23">Twenty Three Tags</data><br />
<time datetime="PT2H30M">2h 30m</time></p>
<details>
<summary>View example source</summary>
<pre><p><code>Code here</code><br />
<kbd>kbd here</kbd><br />
<mark>mark here</mark><br />
<var>Var here</var><br />
<samp>Samp here</samp><br />
<data value="23">Twenty Three Tags</data><br />
<time datetime="PT2H30M">2h 30m</time></p></pre>
</details>
<hr />
<h3>Special word semantics</h3>
<p><var><abbr></var> The HTML Abbreviation element represents an abbreviation or
acronym; the optional title attribute can provide an expansion or description for the abbreviation.</p>
<p><var><dfn></var> The HTML Definition element is used to indicate the term being
defined within the context of a definition phrase or sentence.</p>
<h4>Demo</h4>
<p>An <dfn>abbreviation</dfn> is when text is reduced <abbr title="obviously">obvs</abbr>! It's also slang...</p>
<details>
<summary>View example source</summary>
<pre><p>A <dfn>abbreviation</dfn> is when text is reduced <abbr title="obviously">obvs</abbr>! It's also slang...</p></pre>
</details>
<hr />
<h3>Smaller semantics</h3>
<p><var><small></var> elements represent side-comments and small print, like
copyright and legal text, independent of its styled presentation. By default,
it renders text within it one font-size smaller, such as from small to x-small.</p>
<p><var><sub></var> The HTML Subscript element specifies inline text which should be
displayed as subscript for solely typographical reasons.</p>
<p><var><sup></var> The HTML Superscript element specifies inline text which is to be
displayed as superscript for solely typographical reasons.</p>
<h4>Demo</h4>
<p>Some text needs to be <small>small</small>, some above the line like E=mc<sup>2</sup>.</p>
<p>And some below, like H<sub>2</sub>SO<sub>4</sub>.</p>
<details>
<summary>View example source</summary>
<pre><p>Some text needs to be <small>small</small>, some above the line<sup>*</sup>, like E=mc<sup>2</sup>.</p>
<p>And some below, like H<sub>2</sub>SO<sub>4</sub>.</p></pre>
</details>
<hr />
<h3>Text decoration</h3>
<p><var><u></var> The HTML Unarticulated Annotation Element represents a span of inline
text which should be rendered in a way that indicates that it has a non-textual annotation.</p>
<p><var><s></var> elements render text with a strikethrough, or a line through
it. Used to represent things that are no longer relevant or no longer accurate.
However, it is not appropriate when indicating document edits; for that, use the
<var><del></var> and <var><ins></var> elements, as appropriate.</p>
<h4>Demo</h4>
<p>These tags are styled as an <u>underline</u> or a <s>strikethrough</s>.</p>
<details>
<summary>View example source</summary>
<pre><p>These tags are styled as an <u>underline</u> or a <s>strikethrough</s>.</p></pre>
</details>
<hr />
<h3>White space and containers</h3>
<p><var><br></var> elements produce a line break in text (carriage-return). It
is useful for writing a poem or an address, where the division of lines is significant.</p>
<p><var><wbr></var> elements represent a word break opportunity— a
position within text where the browser may optionally break a line, though its line-breaking rules would not
otherwise create a break at that location.</p>
<hr />
<h2>Language</h2>
<p><var><bdi></var> The HTML Bidirectional Isolate element tells the browser's
bidirectional algorithm to treat the text it contains in isolation from its surrounding text.</p>
<p><var><bdo></var> The HTML Bidirectional Text Override element overrides the current
directionality of text, so that the text within is rendered in a different direction.</p>
<p><var><ruby></var> elements represents a ruby annotation. Ruby annotations
are for showing pronunciation of East Asian characters.</p>
<p><var><rb></var> The HTML Ruby Base element is used to delimit the base text
component of a <var><ruby></var> annotation, i.e. the text that is being annotated.</p>
<p><var><rp></var> The HTML Ruby Fallback Parenthesis element is used to provide
fall-back parentheses for browsers that do not support display of ruby annotations using the <var><ruby></var>
element.</p>
<p><var><rt></var> The HTML Ruby Text element specifies the ruby text component of a
ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian
typography. The <var><rt></var> element must always be contained within a <var><ruby></var> element.</p>
<p><var><rtc></var> The HTML Ruby Text Container element embraces semantic annotations
of characters presented in a ruby of <var><rb></var> elements used inside of <var><ruby></var> element.
<var><rb></var> elements can have both pronunciation (<var><rt></var>) and semantic
(<var><rtc></var>) annotations.</p>
<h4>Demo</h4>
<ul>
<li><bdi class="name">Evil Steven</bdi>: 1st place</li>
<li><bdi class="name">François fatale</bdi>: 2nd place</li>
<li><span class="name">تیز سمی</span>: 3rd place</li>
<li><bdi class="name">الرجل القوي إيان</bdi>: 4th place</li>
<li><span class="name" dir="auto">تیز سمی</span>: 5th place</li>
</ul>
<p>The English song "Oh I do like to be beside the seaside"</p>
<p>Looks like this in Hebrew: <span dir="rtl">אה, אני אוהב להיות ליד חוף הים</span></p>
<p>In the computer's memory, this is stored as <bdo dir="ltr">אה, אני אוהב להיות ליד חוף הים</bdo></p>
<ruby>
<rb>漢<rb>字
<rp>(</rp>
<rt>kan<rt>ji<rp>)</rp>
</ruby>
<rtc xml:lang="en" style="ruby-position: over;">
<rp>(</rp>
<rt>Malaysia</rt>
<rp>)</rp>
</rtc>
<details>
<summary>View example source</summary>
<pre><ul>
<li><bdi class="name">Evil Steven</bdi>: 1st place</li>
<li><bdi class="name">François fatale</bdi>: 2nd place</li>
<li><span class="name">تیز سمی</span>: 3rd place</li>
<li><bdi class="name">الرجل القوي إيان</bdi>: 4th place</li>
<li><span class="name" dir="auto">تیز سمی</span>: 5th place</li>
</ul>
<p>The English song "Oh I do like to be beside the seaside"</p>
<p>Looks like this in Hebrew: <span dir="rtl">אה, אני אוהב להיות ליד חוף הים</span></p>
<p>In the computer's memory, this is stored as <bdo dir="ltr">אה, אני אוהב להיות ליד חוף הים</bdo></p>
<ruby>
<rb>漢<rb>字
<rp>(</rp><rt>kan<rt>ji<rp>)</rp>
</ruby>
<rtc xml:lang="en" style="ruby-position: over;">
<rp>(</rp><rt>Malaysia</rt><rp>)</rp>
</rtc></pre>
</details>
<hr />
<h2>Image and multimedia</h2>
<p>HTML supports various multimedia resources such as images, audio, and video.</p>
<h3>Image maps</h3>
<p><var><area></var> elements define a hot-spot region on an image, and
optionally associates it with a hypertext link. This element is used only within a <var><map></var>
element.</p>
<p><var><map></var> elements are used with <var><area></var> elements to
define an image map (a clickable link area).</p>
<h4>Demo</h4>
<p>Haven't included a demo here, as they're not great responsively without some <a href="https://github.com/davidjbradshaw/image-map-resizer">javascript to adjust sizes</a>.</p>
<details>
<summary>View example source</summary>
<pre><img src="workplace.jpg" alt="Workplace" usemap="#workmap">
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
<area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="Coffee" href="coffee.htm">
</map></pre>
</details>
<hr />
<h3>Image, audio & motion</h3>
<p><var><audio></var> elements are used to embed sound content in documents. It
may contain one or more audio sources, represented using the src attribute or the <var><source></var> element:
the browser will choose the most suitable one. It can also be the destination for streamed media, using a
MediaStream.</p>
<p><var><picture></var> elements contains zero or more <var><source></var> elements
and one <var><img></var> element to offer alternative versions of an image
for different display/device scenarios.</p>
<p><var><video></var> The HTML Video element embeds a media player which supports
video playback into the document. You can use <var><video></var> for audio content as well, but the
<var><audio></var> element may provide a more appropriate user experience.</p>
<p><var><source></var> elements specify multiple media resources for the
<var><picture></var>, the <var><audio></var> element, or the <var><video></var> element.</p>
<p><var><track></var> elements are used as a child of the media elements
<var><audio></var> and <var><video></var>. It lets you specify timed text tracks (or time-based data),
for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web
Video Text Tracks or Timed Text Markup Language (TTML).</p>
<p><var><img></var> The HTML image element embeds an image into the document.</p>
<h4>Demo</h4>
<figure>
<picture>
<source srcset="https://via.placeholder.com/960x150" media="(min-width: 800px)">
<img src="https://via.placeholder.com/720x150" />
</picture>
<figcaption>Placeholder image</figcaption>
</figure>
<figure>
<audio controls>
<source src="audio.mp3" type="audio/mp3">
<source src="audio.ogg" type="audio/ogg">
Your browser does not support the <code>audio</code> element.
</audio>
<figcaption>Simple piano melody</figcaption>
</figure>
<figure>
<video controls>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
<track default kind="captions" srclang="en" src="cue.vtt" />
Sorry, your browser doesn't support embedded videos.
</video>
<figcaption>City traffic at night</figcaption>
</figure>
<details>
<summary>View example source</summary>
<pre><figure>
<picture>
<source srcset="https://via.placeholder.com/960x150" media="(min-width: 800px)">
<img src="https://via.placeholder.com/720x150" />
</picture>
<figcaption>Placeholder image</figcaption>
</figure>
<figure>
<audio controls>
<source src="audio.mp3" type="audio/mp3">
<source src="audio.ogg" type="audio/ogg">
Your browser does not support the <code>audio</code> element.
</audio>
<figcaption>Simple piano melody</figcaption>
</figure>
<figure>
<video controls>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
<track default kind="captions" srclang="en" src="cue.vtt" />
Sorry, your browser doesn't support embedded videos.
</video>
<figcaption>City traffic at night</figcaption>
</figure></pre>
</details>
<hr />
<h2>Embedded content</h2>
<p>In addition to regular multimedia content, HTML can include a variety of other content, even if it's not always
easy to interact with.</p>
<p><var><embed></var> elements place external content at the specified point
in the document. This content is provided by an external application or other source of interactive content such as a
browser plug-in.</p>
<p><var><object></var> elements represent an external resource, which can be
treated as an image, a nested browsing context, or a resource to be handled by a plugin.</p>
<p><var><param></var> The HTML parameter element defines parameters for an
<var><object></var> element.</p>
<p><var><iframe></var> The HTML Inline Frame element represents a nested browsing
context, embedding another HTML page into the current one.</p>
<p>Generally objects and embeds are tricky for compatibility because it's hard to guarentee what the browser can renders, so not a huge amount of effort her went into styling here.</p>
<h4>Demo</h4>
<iframe title="Inline Frame Example" src="iframe.html"></iframe>
<details>
<summary>View example source</summary>
<pre><iframe title="Inline Frame Example" src="iframe.html"></iframe></pre>
</details>
<hr />
<h2>Scripting</h2>
<p>In order to create dynamic content and Web applications, HTML supports the use of scripting
languages, most prominently JavaScript. Certain elements support this capability.</p>
<p><var><canvas></var> elements with either the canvas scripting API or
the WebGL API to draw graphics and animations.</p>
<p><var><noscript></var> elements defines a section of HTML to be inserted
if a script type on the page is unsupported or if scripting is currently turned off in the browser.</p>
<p><var><script></var> elements are used to embed or reference executable
code; this is typically used to embed or refer to JavaScript code.</p>
<h3>Demo</h3>
<canvas id="tutorial" width="150" height="150">
<img src="https://via.placeholder.com/150x150" width="150" height="150" alt="Canvas Fallback" />
</canvas>
<script type="text/javascript">
var canvas = document.getElementById('tutorial');
if (canvas.getContext) {
var ctx = canvas.getContext('2d');
ctx.fillRect(25, 25, 100, 100);
ctx.clearRect(45, 45, 60, 60);
ctx.strokeRect(50, 50, 50, 50);
}
</script>
<noscript>
<p>You don't have javascript enabled.</p>
</noscript>
<details>
<summary>View example source</summary>
<pre><canvas id="clock" width="150" height="150">
<img src="https://via.placeholder.com/150x150" width="150" height="150" alt="Canvas Fallback"/>
</canvas>
<script type="text/javascript">
function draw() {
var canvas = document.getElementById('tutorial');
if (canvas.getContext) {
var ctx = canvas.getContext('2d');
ctx.fillRect(25, 25, 100, 100);
ctx.clearRect(45, 45, 60, 60);
ctx.strokeRect(50, 50, 50, 50);
}
}
</script>
<noscript>
<p>You don't have javascript enabled.</p>
</noscript></pre>
</details>
<hr />
<h2>Demarcating edits</h2>
<p>These elements let you provide indications that specific parts of the text have been altered.</p>
<p><var><del></var> elements represent a range of text that has been deleted from a document.</p>
<p><var><ins></var> elements represent a range of text that has been added to a document.</p>
<h4>Demo</h4>
<p>This is a <ins>smart</ins> pargraph of text with some <del>hacked-in</del> edits.</p>
<details>
<summary>View example source</summary>
<pre><p>This is a <ins>smart</ins> pargraph of text with some <del>hacked-in</del> edits.</p></pre>
</details>
<hr />
<h2>Table content</h2>
<p>The elements here are used to create and handle tabular data.</p>
<p><var><caption></var> elements specify the caption (or title) of a
table.</p>
<p><var><col></var> The HTML column element defines a column within a table and is used for
defining common semantics on all common cells. It is generally found within a <var><colgroup></var>
element.</p>
<p><var><colgroup></var> The HTML Column Group element defines a group of columns within a
table.</p>
<p><var><table></var> elements represent tabular data — that is,
information presented in a two-dimensional table comprised of rows and columns of cells containing data.</p>
<p><var><tbody></var> The HTML Table Body element encapsulates a set of table rows, indicating that
they comprise the body of the table.</p>
<p><var><td></var> or Table Data element defines a cell of a table that contains data. It
participates in the table model.</p>
<p><var><tfoot></var> elements define a set of rows summarizing the columns of the table.</p>
<p><var><th></var> elements define a cell as header of a group of table cells.
The exact nature of this group is defined by the scope and headers attributes.</p>
<p><var><thead></var> element defines a set of rows defining the head of the columns of the table.</p>
<p><var><tr></var> elements define a row of cells in a table. The row's cells
can then be established using a mix of <var><td></var> (data cell) and <var><th></var> (header cell)
elements.</p>
<h4>Demo</h4>
<style>
.highlight {
background: var(--color-access);
}
</style>
<table>
<caption style="caption-side:bottom">All the numbers in a table</caption>
<colgroup>
<col>
<col span="1" class="highlight">
</colgroup>
<thead>
<tr>
<th>Items</th>
<th scope="col">Expenditure</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Donuts</th>
<td>3,000</td>
</tr>
<tr>
<th scope="row">Stationery</th>
<td>18,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Totals</th>
<td>21,000</td>
</tr>
</tfoot>
</table>
<details>
<summary>View example source</summary>
<pre><style>
.highlight { background: var(--color-access);}
</style>
<table>
<caption style="caption-side:bottom">All the numbers in a table</caption>
<colgroup>
<col>
<col span="1" class="highlight">
</colgroup>
<thead>
<tr>
<th>Items</th>
<th scope="col">Expenditure</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Donuts</th>
<td>3,000</td>
</tr>
<tr>
<th scope="row">Stationery</th>
<td>18,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Totals</th>
<td>21,000</td>
</tr>
</tfoot>
</table></pre>
</details>
<hr />
<h2>Forms</h2>
<p>HTML provides a number of elements which can be used together to create forms which the user can fill out and
submit to the Web site or application. There's a great deal of further information about this available in the HTML
forms guide.</p>
<p><var><button></var> elements represent a clickable button, used to submit
forms or anywhere in a document for accessible, standard button functionality.</p>
<p><var><datalist></var> elements contains a set of <var><option></var> elements that
represent the permissible or recommended options available to choose from within other controls.</p>
<p><var><fieldset></var> elements are used to group several controls as well
as labels within a web form.</p>
<p><var><form></var> elements represents a document section containing interactive controls for submitting information.</p>
<p><var><input></var> elements are used to create interactive controls for
web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are
available, depending on the device and user agent.</p>
<p><var><label></var> elements represent a caption for an item in a user interface.</p>
<p><var><legend></var> elements represent a caption for the content of its parent <var><fieldset></var> tag.</p>
<p><var><meter></var> elements represent either a scalar value within a known range or a fractional value.</p>