├── LICENSE
├── README.md
├── demo
├── audio.mp3
├── audio.ogg
├── cue.vtt
├── iframe.html
├── index.html
├── logo.svg
├── search.svg
├── video.mp4
└── video.ogg
├── docs.html
├── favicon.icns
├── favicon.ico
├── gd.css
├── gd.min.css
└── index.html
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Stephen Hawkes
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GDCSS
2 |
3 | [](https://github.com/hawkz/gdcss/blob/master/LICENSE)
4 |
5 | *An accessible alternative to HTML5 CSS resets*
6 |
7 | GDCSS styles all visible HTML elements in line with modern best practice.
8 | It focusses only on HTML tags so you can just write HTML (no classes or frameworks).
9 |
10 | GDCSS is aimed at projects needing to blast out some HTML quickly and turn it into a deployable prototype or site without any other CSS being needed, but also not getting in the way if that is the case.
11 |
12 | [Read the docs](https://gdcss.netlify.app/docs.html).
13 |
14 | * Live demo of current master: https://gdcss.netlify.app/demo/
15 |
16 | ## Installation
17 | Just add the CSS file to the `
` of your HTML.
18 |
19 |
20 |
21 | That's it! simple HTML now becomes a visually accessible page.
22 |
23 | ## Feedback
24 |
25 | Would love to hear you feedback on this, so the form on the landing page is live...
26 |
27 | [Give feedback](https://gdcss.netlify.app/).
28 |
--------------------------------------------------------------------------------
/demo/audio.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hawkz/gdcss/d150be4e17835f2c213e0c66fb20e4e555b53fe4/demo/audio.mp3
--------------------------------------------------------------------------------
/demo/audio.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hawkz/gdcss/d150be4e17835f2c213e0c66fb20e4e555b53fe4/demo/audio.ogg
--------------------------------------------------------------------------------
/demo/cue.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT - This file has cues.
2 |
3 |
4 | 00:00:00.000 --> 00:00:04.000
5 | This is a sample
6 |
7 | 00:00:04.000 --> 00:06:00.000
8 | - More accessible!
9 |
--------------------------------------------------------------------------------
/demo/iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | iFrame
7 |
8 |
9 |
10 |
11 |
12 |
13 | Body > HEADER
14 |
15 |
16 |
17 |
18 |
19 | Body HEADER
20 |
21 | Body
22 |
23 |
24 | ARTICLE
25 |
26 |
27 |
28 |
29 |
30 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | GDCSS - Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Skip to main content
24 |
25 |
26 |
34 |
35 |
40 |
41 |
42 |
43 |
The a tag stands for anchor from old hypertext speak. You can use abbr to abbreviate things. q is for creating a short quotation, great for getting smart quotes in without
52 | thinking about symbols, and also making the page more semantic. If you want to emphasise text you can use or em to do that, depending on the need for style or semantic emphasis.
53 |
54 |
55 |
59 |
63 |
67 |
68 |
69 |
70 |
Some title smaller
71 |
Big heading
72 |
73 |
74 |
75 | Big quote
76 |
"Quote"
77 | - Attribution
78 |
79 |
80 |
Citation of titles aren't usually visible cite the same is true of data.
81 | There's also few cases where you need ins (inserted text) or del (which is deleted text)
82 | unless you're tracking changes. Similarly the s tag specifies text that is no longer correct, accurate or relevant.
83 | The dfn tag represents the defining instance of a term in HTML, which could be useful for semantic expression.
84 |
85 |
Some microformats and search engines can understand your address:
86 | address, street
87 | and
88 | postcode
89 |
90 |
Phrase tags
91 |
The human phrase tags are em which renders as emphasized text. and strong which defines important text.
92 |
Then we have a set of computer related tags, which we style all the same, they are
93 | samp, defines sample output from a computer program,
94 | kdb which defines keyboard input and var which
95 | defines a variable. These are super rare, so they all look the same to save writing styles.
96 |
97 |
98 |
em Renders as emphasized text
99 |
strong Defines important text
100 |
code Defines a piece of computer code
101 |
samp Defines sample output from a computer program
102 |
kbd Defines keyboard input
103 |
var Defines a variable like OK
104 |
105 |
Pre, samp & code
106 |
Then there's code which in this framework's opion is more like address and used as a block rather than an inline.
107 | Defines a piece of computer code
108 |
The pre tag defines preformatted text. It's at the same level as p.
109 |
— preformatted text
110 |
— code block
111 |
— computer output block
112 | — inline computer output
113 |
114 |
the b, i, u & strong tags
115 |
b and strong are there for emphasis. We add basic typographical queues here. The i tag defines a part of text in an alternate voice or mood usually displayed in italic. The u tag represents some text that
116 | should be stylistically different from normal text, such as misspelled words or proper nouns in Chinese.
117 |
118 |
119 |
120 |
Use these elements only when there is not a more appropriate semantic element, such as: em, strong, mark,
121 | cite, dfn.
122 |
123 |
The small tag defines smaller text (and other side comments). This text contains subscript text. This text contains superscript text. Time is a tag for semanticly adding
124 | timestamps like for . var tag is a phrase tag. It defines a variable.
125 |
126 |
Use the mark tag if you want to highlight parts of your text.
127 |
128 |
129 | Summary is the visible part of a details toggle
130 | details tag contains the content that is hidden.
131 |
132 |
133 |
134 |
135 |
Headings and paragraphs
136 |
That was a heading level 1, often the biggest heading. Really this is about creating good semantic page structure for accessibility.
137 |
h2 heading
138 |
That was a heading level 2, usually smaller than the previous heading. Really this is about creating good semantic page structure for accessibility.
139 |
h3 heading
140 |
That was a heading level 2, usually smaller than the previous heading. Really this is about creating good semantic page structure for accessibility.
141 |
h4 heading
142 |
That was a heading level 2, usually smaller than the previous heading. Really this is about creating good semantic page structure for accessibility.
143 |
h5 heading
144 |
That was a heading level 2, usually smaller than the previous heading. Really this is about creating good semantic page structure for accessibility.
145 |
h6 heading
146 |
That was a heading level 2, usually smaller than the previous heading. Really this is about creating good semantic page structure for accessibility.
147 |
148 |
149 |
150 |
151 |
Forms and field widgets
152 |
350 |
351 |
352 |
353 |
354 |
Lists
355 |
356 |
357 |
358 |
Unordered list item
359 |
Unordered list item
360 |
Unordered list item
361 |
Unordered list item
362 |
363 |
364 |
365 |
366 |
Ordered list item
367 |
Ordered list item
368 |
Ordered list item
369 |
Ordered list item
370 |
371 |
372 |
373 |
374 |
Definition term
375 |
Definition description
376 |
Definition term
377 |
Definition description
378 |
Definition term
379 |
Definition description
380 |
Definition term
381 |
Definition description
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
Media
390 |
391 |
392 |
393 |
Figure
394 |
395 |
396 | The figcaption tag defines a caption for a figure element.
397 |
398 |
399 |
400 |
Picture
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
SVG
410 |
413 |
414 |
Audio
415 |
420 |
421 |
Video
422 |
428 |
429 |
Meters & Progress bars
430 | 10 out of 100
431 |
432 |
433 |
434 |
435 |
436 |
437 |
IFrame
438 |
439 |
440 |
Canvas
441 |
442 |
448 |
449 |
450 |
451 |
452 |
Tables
453 |
454 |
The caption tag goes straight after table.
455 |
456 |
457 |
Month
458 |
Savings
459 |
460 |
461 |
462 |
463 |
January
464 |
$100
465 |
466 |
467 |
February
468 |
$80
469 |
470 |
471 |
472 |
473 |
Sum
474 |
$180
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
Internationalisation
483 |
484 |
485 |
BDO & BDI
486 |
Sometimes you need text to change direction mid-flow, this is what BDI is for, a great example is usernames.
487 |
488 |
عندما يريد العالم أن يتكلّم ، فهو يتحدّث بلغة يونيكود. تسجّل الآن لحضور المؤتمر الدولي العاشر ليونيكود (Unicode Conference)، الذي سيعقد في 10-12 آذار 1997 بمدينة مَايِنْتْس، ألمانيا. و سيجمع المؤتمر بين خبراء من كافة قطاعات الصناعة
489 | على الشبكة العالمية انترنيت ويونيكود، حيث ستتم، على الصعيدين الدولي والمحلي على حد سواء مناقشة سبل استخدام يونكود في النظم القائمة وفيما يخص التطبيقات الحاسوبية، الخطوط، تصميم النصوص والحوسبة متعددة اللغات.
490 |
491 |
مَمِمّمَّمِّ
492 |
493 |
Which is useful for wrapping blocks of content with languages that flow in that direction.
494 |
495 |
496 |
Ruby
497 |
A ruby annotation is a small extra text, attached to the main text to indicate the pronunciation or meaning of the corresponding characters. This kind of annotation is often used in Japanese publications. The rp tag can be used
498 | to
499 | provide parentheses around a ruby text, to be shown by browsers that do not support ruby annotations. The rt tag defines an explanation or pronunciation of characters (for East Asian typography) in a ruby annotation.
500 |
501 | 漢
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
Page structural elements
510 |
511 |
512 |
Header
513 |
The header element represents a container for introductory content or a set of navigational links.A header element typically contains: one or more heading elements (h1 - h6), logo & branding etc. You can have several header elements in one
514 | document.
515 |
Note: A header tag cannot be placed within a footer, address or another header element.
516 |
517 |
518 |
519 |
520 |
Article
521 |
The article 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.
522 |
523 |
524 |
528 |
529 |
530 |
531 |
532 |
DIVs don't do anything
533 |
534 |
As it should be 😅 I've left them alone, this means they can be containers, you can add styling or classes to them to build what you want.
535 |
A good test of this stylesheet is to try out all of the tags. Here is the tag reference from Mozilla with demo
45 | code and examples of how each tag is styled.
46 |
47 |
There are also CSS variables for the main
48 | colours, so if you need to retheme the colour scheme you can!
49 |
50 |
Head, body, meta code
51 |
52 |
Metadata contains information about the page. This includes information about styles, scripts and data to help
53 | software (search engines, browsers, etc.) use and render the page. Metadata for styles and scripts may be defined in
54 | the page or link to another file that has the information.
55 |
56 |
<html>The HTML element represents the root (top-level element) of an HTML document, so it is also
57 | referred to as the root element. All other elements must be descendants of this element.
58 |
59 |
<base> elements specify the base URL to use for all relative
60 | URLs in a document.
61 |
62 |
<head> elements contains machine-readable information (metadata)
63 | about the document, like its title, scripts, and style sheets.
64 |
65 |
<link> The HTML External Resource Link element specifies relationships
66 | between the current document and an external resource. This element is most commonly used to link to stylesheets, but
67 | is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile
68 | devices) among other things.
69 |
70 |
<style> elements contain style information for a document, or part of a document.
71 |
72 |
<title> defines the document's title that is shown in a browser's title bar or a page's tab.
73 |
74 |
<meta> elements represent metadata that cannot be represented by
75 | other HTML meta-related elements, like <base>, <link>, <script>,
76 | <style> or <title>.
77 |
78 |
<body> element represents the content of an HTML document. There can be only one in a document.
79 |
80 |
Demo
81 |
You're already seeing it, but a lot of the head / meta content isn't visible directly...
Content sectioning elements allow you to organize the document content into logical pieces. Use the sectioning
104 | elements to create a broad outline for your page content, including header and footer navigation, and heading
105 | elements to identify sections of content.
106 |
107 |
Layout
108 |
Really HTML is about semantics, but these particular tags have been styled in so that they also produce common layout patterns.
109 |
110 |
<article> elements represent a self-contained composition in
111 | a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in
112 | syndication).
113 |
114 |
<aside> elements represents a portion of a document whose
115 | content is only indirectly related to the document's main content.
116 |
117 |
<footer> elements represents a footer for its nearest
118 | sectioning content or sectioning root element. A footer typically contains information about the author of the
119 | section, copyright data or links to related documents.
120 |
121 |
<header> elements represent introductory content, typically a
122 | group of introductory or navigational aids. It may contain some heading elements but also a logo, a search form, an
123 | author name, and other elements.
124 |
125 |
<main> elements represent the dominant content of the
126 | <body> of a document. The main content area consists of content that is directly related to or
127 | expands upon the central topic of a document, or the central functionality of an application.
128 |
129 |
<nav> elements represent a section of a page whose purpose is to
130 | provide navigation links, either within the current document or to other documents. Common examples of navigation
131 | sections are menus, tables of contents, and indexes.
<section> elements represents a standalone section
162 | — which doesn't have a more specific semantic element to represent it — contained within an HTML
163 | 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.
<h1>, <h2>, <h3>, <h4>, <h5>,
197 | <h6> The HTML <h1>–<h6> elements represent six levels of
198 | section headings. <h1> is the highest section level and <h6> is the lowest.
<hgroup> elements represent a multi-level heading for a
223 | section of a document. It groups a set of <h1>–<h6> elements. We use this grouping to show the combination style variants of the headers.
Use HTML text content elements to organize blocks or sections of content placed between the opening
243 | <body> and closing </body> tags. Important for accessibility and SEO, these
244 | elements identify the purpose or structure of that content.
245 |
246 |
<address> elements indicate that the enclosed HTML provides
247 | contact information for a person or people, or for an organisation.
<blockquote> elements (or Block Quotation Element)
267 | indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see
268 | Notes for how to change it). A URL for the source of the quotation may be given using the cite attribute, while a
269 | text representation of the source can be given using the <cite> element.
270 |
271 |
<q> elements indicate that the enclosed text is a short inline
272 | quotation. Most modern browsers implement this by surrounding the text in quotation marks.
273 |
274 |
<cite> The HTML Citation element is used to describe a reference to a
275 | cited creative work, and must include the title of that work.
276 |
277 |
Demo
278 |
279 | Make your service look and feel like GOV.UK.
280 | GOV.UK Design System team
281 |
282 |
283 | View example source
284 |
<blockquote cite="https://design-system.service.gov.uk/styles/">
285 | <q>Make your service look and feel like GOV.UK.</q>
286 | <cite>GOV.UK Design System team</cite>
287 | </blockquote>
288 |
289 |
290 |
291 |
292 |
Containers for styling
293 |
294 |
<div> The HTML Content Division element is the generic container for
295 | 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 <section> tags to manage the CSS grid.
296 |
297 |
<span> elements are a generic inline container for phrasing
298 | content, which does not inherently represent anything. It can be used to group elements for styling purposes (using
299 | the class or id attributes), or because they share attribute values, such as lang.
300 |
301 |
302 |
303 |
<dl> elements represent a description list. The element encloses a
304 | list of groups of terms and descriptions. Common uses for this element are to implement a glossary
305 | or to display metadata (a list of key-value pairs).
306 |
307 |
<dt> elements specify a term in a description or definition list.
308 |
309 |
<dd> elements provide the description, definition, or value for
310 | the preceding term in a description list.
<figure> (Figure With Optional Caption) element represents
336 | self-contained content, potentially with an optional caption.
337 |
338 |
<figcaption> or Figure Caption element represents a
339 | caption or legend describing the rest of the contents of its parent <figure> element.
340 |
341 |
Demo
342 |
343 |
344 | The figcaption tag defines a caption for a figure element.
345 |
346 |
347 | View example source
348 |
<figure>
349 | <img src="https://via.placeholder.com/960x320" alt="The figure tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.">
350 | <figcaption>The figcaption tag defines a caption for a figure element.</figcaption>
351 | </figure>
352 |
353 |
354 |
355 |
356 |
<hr> elements represent a thematic break between paragraph-level
357 | 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.
358 |
359 |
360 | View example source
361 |
<hr />
362 |
363 |
364 |
365 |
366 |
<ul> elements represent an unordered list of items, typically rendered as a bulleted list.
367 |
368 |
<ol> elements represent an ordered list of items — typically rendered as a numbered list.
369 |
370 |
<li> elements is used to represent an item, normally in an ordered or unordered list.
<p> elements represent a paragraph. This line of text is in a paragraph.
399 |
400 |
401 | View example source
402 |
<p>Some text and inline elements here.</p>
403 |
404 |
405 |
406 |
407 |
<pre> elements represents preformatted text which is to be
408 | presented exactly as written in the HTML file.
409 |
410 |
Demo
411 |
Some text where
412 | the indentation
413 | matters
414 | to and isn't altered by the browser...
415 |
416 | View example source
417 |
<pre>Some text where
418 | the indentation
419 | matters
420 | to and isn't altered by the browser...</pre>
421 |
422 |
423 |
424 |
425 |
Inline text semantics
426 |
Use the HTML inline text semantic to define the meaning, structure, or style of a word, line, or any arbitrary
427 | piece of text.
428 |
429 |
<a> elements (or anchor element), with its href attribute, creates a
430 | hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address.
431 |
432 |
Demo
433 |
We see these a lot on, here is your common link, standard variety. To make things more fun, we also added some extra cases based on how you use them: External links, Back
434 | links, and Top links for common icon inclusion.
435 |
436 | View example source
437 |
<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>
438 |
439 |
440 |
441 |
442 |
Emphasis
443 |
444 |
<b> The HTML Bring Attention To element is used to draw the reader's
445 | attention to the element's contents, which are not otherwise granted special importance.
446 |
447 |
<strong> The HTML Strong Importance Element indicates that its
448 | contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.
449 |
450 |
<em> elements mark text that has stress emphasis. It can be nested,
451 | with each level of nesting indicating a greater degree of emphasis.
452 |
453 |
<i> elements represent a range of text that is set off from the
454 | normal text for some reason.
455 |
456 |
Demo
457 |
There's lots of ways to show emphasis with bold, strong tags varying weight and em and italics for text styles.
458 |
459 | View example source
460 |
<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>
461 |
462 |
463 |
464 |
465 |
466 |
Code and outputs
467 |
468 |
<code> elements display its contents styled in a fashion
469 | intended to indicate that the text is a short fragment of computer code.
470 |
471 |
<kbd> The HTML Keyboard Input element represents a span of inline text
472 | denoting textual user input from a keyboard, voice input, or any other text entry device.
473 |
474 |
<mark> The HTML Mark Text element represents text which is marked or
475 | highlighted for reference or notation purposes, due to the marked passage's relevance or
476 | importance in the enclosing context.
477 |
478 |
<var> The HTML Variable element represents the name of a variable in a
479 | mathematical expression or a programming context.
480 |
481 |
<samp> The HTML Sample Element is used to enclose inline text which
482 | represents sample (or quoted) output from a computer program.
483 |
484 |
<data> elements link a given content with a machine-readable
485 | translation. If the content is time- or date-related, the <time> element must be used.
486 | Nothing visible, but adds semantic expression.
487 |
488 |
<time> elements represent a specific period in time. Nothing visible, but adds semantic expression.
489 |
490 |
Demo
491 |
Code here
492 | kbd here
493 | mark here
494 | Var here
495 | Samp here
496 | Twenty Three Tags
497 |
<abbr> The HTML Abbreviation element represents an abbreviation or
514 | acronym; the optional title attribute can provide an expansion or description for the abbreviation.
515 |
516 |
<dfn> The HTML Definition element is used to indicate the term being
517 | defined within the context of a definition phrase or sentence.
518 |
519 |
Demo
520 |
An abbreviation is when text is reduced obvs! It's also slang...
521 |
522 | View example source
523 |
<p>A <dfn>abbreviation</dfn> is when text is reduced <abbr title="obviously">obvs</abbr>! It's also slang...</p>
524 |
525 |
526 |
527 |
528 |
Smaller semantics
529 |
530 |
<small> elements represent side-comments and small print, like
531 | copyright and legal text, independent of its styled presentation. By default,
532 | it renders text within it one font-size smaller, such as from small to x-small.
533 |
534 |
<sub> The HTML Subscript element specifies inline text which should be
535 | displayed as subscript for solely typographical reasons.
536 |
537 |
<sup> The HTML Superscript element specifies inline text which is to be
538 | displayed as superscript for solely typographical reasons.
539 |
540 |
Demo
541 |
Some text needs to be small, some above the line like E=mc2.
542 |
And some below, like H2SO4.
543 |
544 |
545 | View example source
546 |
<p>Some text needs to be <small>small</small>, some above the line<sup>*</sup>, like E=mc<sup>2</sup>.</p>
547 | <p>And some below, like H<sub>2</sub>SO<sub>4</sub>.</p>
548 |
549 |
550 |
551 |
552 |
Text decoration
553 |
554 |
<u> The HTML Unarticulated Annotation Element represents a span of inline
555 | text which should be rendered in a way that indicates that it has a non-textual annotation.
556 |
557 |
<s> elements render text with a strikethrough, or a line through
558 | it. Used to represent things that are no longer relevant or no longer accurate.
559 | However, it is not appropriate when indicating document edits; for that, use the
560 | <del> and <ins> elements, as appropriate.
561 |
562 |
Demo
563 |
These tags are styled as an underline or a strikethrough.
564 |
565 |
566 | View example source
567 |
<p>These tags are styled as an <u>underline</u> or a <s>strikethrough</s>.</p>
568 |
569 |
570 |
571 |
572 |
White space and containers
573 |
574 |
<br> elements produce a line break in text (carriage-return). It
575 | is useful for writing a poem or an address, where the division of lines is significant.
576 |
577 |
<wbr> elements represent a word break opportunity— a
578 | position within text where the browser may optionally break a line, though its line-breaking rules would not
579 | otherwise create a break at that location.
580 |
581 |
582 |
583 |
Language
584 |
585 |
<bdi> The HTML Bidirectional Isolate element tells the browser's
586 | bidirectional algorithm to treat the text it contains in isolation from its surrounding text.
587 |
588 |
<bdo> The HTML Bidirectional Text Override element overrides the current
589 | directionality of text, so that the text within is rendered in a different direction.
590 |
591 |
<ruby> elements represents a ruby annotation. Ruby annotations
592 | are for showing pronunciation of East Asian characters.
593 |
594 |
<rb> The HTML Ruby Base element is used to delimit the base text
595 | component of a <ruby> annotation, i.e. the text that is being annotated.
596 |
597 |
<rp> The HTML Ruby Fallback Parenthesis element is used to provide
598 | fall-back parentheses for browsers that do not support display of ruby annotations using the <ruby>
599 | element.
600 |
601 |
<rt> The HTML Ruby Text element specifies the ruby text component of a
602 | ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian
603 | typography. The <rt> element must always be contained within a <ruby> element.
604 |
605 |
<rtc> The HTML Ruby Text Container element embraces semantic annotations
606 | of characters presented in a ruby of <rb> elements used inside of <ruby> element.
607 | <rb> elements can have both pronunciation (<rt>) and semantic
608 | (<rtc>) annotations.
609 |
610 |
Demo
611 |
612 |
Evil Steven: 1st place
613 |
François fatale: 2nd place
614 |
تیز سمی: 3rd place
615 |
الرجل القوي إيان: 4th place
616 |
تیز سمی: 5th place
617 |
618 |
The English song "Oh I do like to be beside the seaside"
619 |
Looks like this in Hebrew: אה, אני אוהב להיות ליד חוף הים
620 |
In the computer's memory, this is stored as אה, אני אוהב להיות ליד חוף הים
<ul>
635 | <li><bdi class="name">Evil Steven</bdi>: 1st place</li>
636 | <li><bdi class="name">François fatale</bdi>: 2nd place</li>
637 | <li><span class="name">تیز سمی</span>: 3rd place</li>
638 | <li><bdi class="name">الرجل القوي إيان</bdi>: 4th place</li>
639 | <li><span class="name" dir="auto">تیز سمی</span>: 5th place</li>
640 | </ul>
641 | <p>The English song "Oh I do like to be beside the seaside"</p>
642 | <p>Looks like this in Hebrew: <span dir="rtl">אה, אני אוהב להיות ליד חוף הים</span></p>
643 | <p>In the computer's memory, this is stored as <bdo dir="ltr">אה, אני אוהב להיות ליד חוף הים</bdo></p>
644 | <ruby>
645 | <rb>漢<rb>字
646 | <rp>(</rp><rt>kan<rt>ji<rp>)</rp>
647 | </ruby>
648 | <rtc xml:lang="en" style="ruby-position: over;">
649 | <rp>(</rp><rt>Malaysia</rt><rp>)</rp>
650 | </rtc>
651 |
652 |
653 |
654 |
655 |
Image and multimedia
656 |
657 |
HTML supports various multimedia resources such as images, audio, and video.
658 |
659 |
Image maps
660 |
661 |
<area> elements define a hot-spot region on an image, and
662 | optionally associates it with a hypertext link. This element is used only within a <map>
663 | element.
664 |
665 |
<map> elements are used with <area> elements to
666 | define an image map (a clickable link area).
667 |
668 |
Demo
669 |
Haven't included a demo here, as they're not great responsively without some javascript to adjust sizes.
<audio> elements are used to embed sound content in documents. It
686 | may contain one or more audio sources, represented using the src attribute or the <source> element:
687 | the browser will choose the most suitable one. It can also be the destination for streamed media, using a
688 | MediaStream.
689 |
690 |
<picture> elements contains zero or more <source> elements
691 | and one <img> element to offer alternative versions of an image
692 | for different display/device scenarios.
693 |
694 |
<video> The HTML Video element embeds a media player which supports
695 | video playback into the document. You can use <video> for audio content as well, but the
696 | <audio> element may provide a more appropriate user experience.
697 |
698 |
<source> elements specify multiple media resources for the
699 | <picture>, the <audio> element, or the <video> element.
700 |
701 |
<track> elements are used as a child of the media elements
702 | <audio> and <video>. It lets you specify timed text tracks (or time-based data),
703 | for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web
704 | Video Text Tracks or Timed Text Markup Language (TTML).
705 |
706 |
<img> The HTML image element embeds an image into the document.
In addition to regular multimedia content, HTML can include a variety of other content, even if it's not always
769 | easy to interact with.
770 |
771 |
<embed> elements place external content at the specified point
772 | in the document. This content is provided by an external application or other source of interactive content such as a
773 | browser plug-in.
774 |
775 |
<object> elements represent an external resource, which can be
776 | treated as an image, a nested browsing context, or a resource to be handled by a plugin.
777 |
778 |
<param> The HTML parameter element defines parameters for an
779 | <object> element.
780 |
781 |
<iframe> The HTML Inline Frame element represents a nested browsing
782 | context, embedding another HTML page into the current one.
783 |
784 |
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.
In order to create dynamic content and Web applications, HTML supports the use of scripting
797 | languages, most prominently JavaScript. Certain elements support this capability.
798 |
799 |
<canvas> elements with either the canvas scripting API or
800 | the WebGL API to draw graphics and animations.
801 |
802 |
<noscript> elements defines a section of HTML to be inserted
803 | if a script type on the page is unsupported or if scripting is currently turned off in the browser.
804 |
805 |
<script> elements are used to embed or reference executable
806 | code; this is typically used to embed or refer to JavaScript code.
These elements let you provide indications that specific parts of the text have been altered.
851 |
852 |
<del> elements represent a range of text that has been deleted from a document.
853 |
854 |
<ins> elements represent a range of text that has been added to a document.
855 |
856 |
Demo
857 |
This is a smart pargraph of text with some hacked-in edits.
858 |
859 | View example source
860 |
<p>This is a <ins>smart</ins> pargraph of text with some <del>hacked-in</del> edits.</p>
861 |
862 |
863 |
864 |
865 |
866 |
Table content
867 |
868 |
The elements here are used to create and handle tabular data.
869 |
870 |
<caption> elements specify the caption (or title) of a
871 | table.
872 |
873 |
<col> The HTML column element defines a column within a table and is used for
874 | defining common semantics on all common cells. It is generally found within a <colgroup>
875 | element.
876 |
877 |
<colgroup> The HTML Column Group element defines a group of columns within a
878 | table.
879 |
880 |
<table> elements represent tabular data — that is,
881 | information presented in a two-dimensional table comprised of rows and columns of cells containing data.
882 |
883 |
<tbody> The HTML Table Body element encapsulates a set of table rows, indicating that
884 | they comprise the body of the table.
885 |
886 |
<td> or Table Data element defines a cell of a table that contains data. It
887 | participates in the table model.
888 |
889 |
<tfoot> elements define a set of rows summarizing the columns of the table.
890 |
891 |
<th> elements define a cell as header of a group of table cells.
892 | The exact nature of this group is defined by the scope and headers attributes.
893 |
894 |
<thead> element defines a set of rows defining the head of the columns of the table.
895 |
896 |
<tr> elements define a row of cells in a table. The row's cells
897 | can then be established using a mix of <td> (data cell) and <th> (header cell)
898 | elements.
HTML provides a number of elements which can be used together to create forms which the user can fill out and
978 | submit to the Web site or application. There's a great deal of further information about this available in the HTML
979 | forms guide.
980 |
981 |
<button> elements represent a clickable button, used to submit
982 | forms or anywhere in a document for accessible, standard button functionality.
983 |
984 |
<datalist> elements contains a set of <option> elements that
985 | represent the permissible or recommended options available to choose from within other controls.
986 |
987 |
<fieldset> elements are used to group several controls as well
988 | as labels within a web form.
989 |
990 |
<form> elements represents a document section containing interactive controls for submitting information.
991 |
992 |
<input> elements are used to create interactive controls for
993 | web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are
994 | available, depending on the device and user agent.
995 |
996 |
<label> elements represent a caption for an item in a user interface.
997 |
998 |
<legend> elements represent a caption for the content of its parent <fieldset> tag.
999 |
1000 |
<meter> elements represent either a scalar value within a known range or a fractional value.
1001 |
1002 |
<optgroup> elements create a grouping of options within a <select> element.
1003 |
1004 |
<option> elements are used to define an item contained in a
1005 | <select>, an <optgroup>, or a <datalist> element. As such,
1006 | <option> can represent menu items in popups and other lists of items in an HTML document.
1007 |
1008 |
<output> The HTML Output element is a container element into which a
1009 | site or app can inject the results of a calculation or the outcome of a user action.
1010 |
1011 |
<progress> elements display an indicator showing the
1012 | completion progress of a task, typically displayed as a progress bar.
1013 |
1014 |
<select> elements represent a control that provides a menu of options
1015 |
1016 |
<textarea> elements represent a multi-line plain-text editing control, useful when you
1017 | want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.
1018 |
1019 |
Demo
1020 |
1084 |
1085 |
1086 |
1087 |
1088 |
Interactive elements
1089 |
1090 |
HTML offers a selection of elements which help to create interactive user interface objects.
1091 |
1092 |
<details> The HTML Details Element creates a disclosure widget in
1093 | which information is visible only when the widget is toggled into an "open" state. You can see these for each of the demo sections n this page.
1094 |
1095 |
<summary> The HTML Disclosure Summary element element specifies a
1096 | summary, caption, or legend for a <details> element's disclosure box.
gd.css styles all visible HTML elements in line with modern best practice.
47 | It focusses only on HTML tags so you can just write HTML (no classes) and make pages like this.
48 |
49 |
50 |
51 |
52 |
53 |
54 |
Getting started
55 |
Like most CSS libraries, all you need to do is include the library in your HTML. To do this just link to this sheet (or download and link to your own URL):
76 | I couldn't figure out how to setup the GOV.UK prototype toolkit, so writing this seemed like the simple thing to do.
77 | - Steve Hawkes (author)
78 |