The snippet library.
Small, practical examples. Search by task or narrow things down below.
Accept several lines of text
HTML: Learn how to accept several lines of text in a complete browser example.
HTML✓ Tested
Add a button with an explicit type
HTML: Learn how to add a button with an explicit type in a complete browser example.
HTML✓ Tested
Add an expandable explanation
HTML: Learn how to add an expandable explanation in a complete browser example.
HTML✓ Tested
Associate a text field with its label
HTML: Learn how to associate a text field with its label in a complete browser example.
HTML✓ Tested
Attach a custom data attribute
HTML: Learn how to attach a custom data attribute in a complete browser example.
HTML✓ Tested
Build a first radio-button group
HTML: Learn how to build a first radio-button group in a complete browser example.
HTML✓ Tested
Create a complete HTML document
HTML: Learn how to create a complete HTML document in a complete browser example.
HTML✓ Tested
Create a small table with headers
HTML: Learn how to create a small table with headers in a complete browser example.
HTML✓ Tested
Declare the document language and encoding
HTML: Learn how to declare the document language and encoding in a complete browser example.
HTML✓ Tested
Describe terms in a definition list
HTML: Learn how to describe terms in a definition list in a complete browser example.
HTML✓ Tested
Display a short code sample
HTML: Learn how to display a short code sample in a complete browser example.
HTML✓ Tested
Display reserved characters as text
HTML: Learn how to display reserved characters as text in a complete browser example.
HTML✓ Tested