Training page :]
Main pageThis is a paragraph.
This is another paragraph.
this is a paragraph
with a line break
this is a text with 60px size
This paragraph contains a lot of spaces and lines in the source code, but the browser ignores it.
this paragraph has a
"powderblue" background and "grey" color font
this paragraph has a
"tomato" background
this paragraph has a
"rgba(10, 55, 73, 0.7)" background, "white" color font
and "courrier" font
this parahraph is centered
this parahraph is aligned left
this parahraph is aligned right
in this code, there is a hidden comment
border time :D
hehehehe
theehee :3
bordered text with 30px padding and 50px margin
this image hosts a link to lukas' tumblr page
you can send an demail to someone@example.com by clicking here
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
Float the image to the left:
A paragraph with a floating image. A paragraph with a floating image. A paragraph with a floating image.
click over different parts of the image to open different links
a simple table
Person 1 | Person 2 | Person 3 |
---|---|---|
Emil | Tobias | Linus |
16 | 14 | 10 |
Firstname (this column 50% of the table's total space) | Lastname (this is part of the header of the table) | Age |
---|---|---|
Jill (this line is 200px) | Smith | 50 |
Eve | Jackson | 94 |
John | Doe | 80 |
Name | Age | |
---|---|---|
Jill | Smith | 50 |
Eve | Jackson | 94 |
Add the a colgroup with a col element that spans over two columns to define a style for the two columns:
MON | TUE | WED | THU | FRI | SAT | SUN |
---|---|---|---|---|---|---|
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 |
You may also use other types like : disc, circle, square or none.
Lists can be nested (list inside list):
type="1" The list items will be numbered with numbers (default)
type="A" The list items will be numbered with uppercase letters
type="a" The list items will be numbered with lowercase letters
type="I" The list items will be numbered with uppercase roman numbers
type="i" The list items will be numbered with lowercase roman numbers
By default, an ordered list will start counting from 1. Use the start attribute to start counting from a specified number:
My mother has blue eyes and my father has brown eyes.
My favorite color is red.
When the target attribute of a link matches the name of an iframe, the link will open in the iframe.
What day is it?
will i change?
you can use the head element to: - define the title of the page - define a style - link a css stylesheet or a javascript file - use some meta tags to: * define the character set used: * define keywords for search engines: * define a description of your web page: * define the author of a page * refresh document every 30 seconds * setting the viewport to make your website look good on all devices - set the viewport (size of your pages depending onthe device) - define your java scripts - use the base tag to define the base target of your links
Resize the browser window to see how the text size scales.
Use the "vw" unit when sizing the text. 5vw will set the size to 5% of the viewport width.
Viewport is the browser window size. 1vw = 1% of viewport width. If the viewport is 50cm wide, 1vw is 0.5cm.
the page layout will change depending on the size of the browser
Below is a list of some of the semantic elements in HTML.
Tag | Description |
---|---|
<article> | Defines independent, self-contained content |
<aside> | Defines content aside from the page content |
<details> | Defines additional details that the user can view or hide |
<figcaption> | Defines a caption for a <figure> element |
<figure> | Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc. |
<footer> | Defines a footer for a document or section |
<header> | Specifies a header for a document or section |
<main> | Specifies the main content of a document |
<mark> | Defines marked/highlighted text |
<nav> | Defines navigation links |
<section> | Defines a section in a document |
<summary> | Defines a visible heading for a <details> element |
<time> | Defines a date/time |
Result | Description | Entity Name | Entity Number |
---|---|---|---|
non-breaking space | |   | |
< | less than | < | < |
> | greater than | > | > |
& | ampersand | & | & |
" | double quotation mark | " | " |
' | single quotation mark (apostrophe) | ' | ' |
¢ | cent | ¢ | ¢ |
£ | pound | £ | £ |
¥ | yen | ¥ | ¥ |
€ | euro | € | € |
© | copyright | © | © |
® | registered trademark | ® | ® |
The HTML <form> element is used to create an HTML form for user input:
The HTML<input>element is the most used form element.
An<input>element can be displayed in many ways, depending on the type attribute.
Here are some examples:
Type | Description |
---|---|
<input type="text"> | Displays a single-line text input field |
<input type="radio"> | Displays a radio button (for selecting one of many choices) |
<input type="checkbox"> | Displays a checkbox (for selecting zero or more of many choices) |
<input type="submit"> | Displays a submit button (for submitting the form) |
<input type="button"> | Displays a clickable button |
The <input type="text"> defines a single-line input field for text input.
A form with input fields for text:
This is how the HTML code above will be displayed in a browser:
Note: The form itself is not visible. Also note that the default width of an input field is 20 characters.
Radio buttons let a user select ONE of a limited number of choices.
Choose your favorite Web language:
Checkboxes let a user select ZERO or MORE options of a limited number of choices.
Which do you own?
If the name attribute is omitted, the value of the input field will not be sent at all.
Attribute | Description |
---|---|
accept-charset | Specifies the character encodings used for form submission |
action | Specifies where to send the form-data when a form is submitted |
autocomplete | Specifies whether a form should have autocomplete on or off |
enctype | Specifies how the form-data should be encoded when submitting it to the server (only for method="post") |
method | Specifies the HTTP method to use when sending form-data |
name | Specifies the name of the form |
novalidate | Specifies that the form should not be validated when submitted |
rel | Specifies the relationship between a linked resource and the current document |
target | Specifies where to display the response that is received after submitting the form |
Tag | Description | |
---|---|---|
<form> | Defines an HTML form for user input | |
<input> | Defines an input control | |
<textarea> | Defines a multiline input control (text area) | |
<label> | Defines a label for an <input> element |
The for attribute of the <label> tag should be equal to the id attribute of the <input> element to bind them together. |
<fieldset> | Groups related elements in a form | |
<legend> | Defines a caption for a <fieldset> element | |
<select> | Defines a drop-down list | |
<optgroup> | Defines a group of related options in a drop-down list | |
<option> | Defines an option in a drop-down list | |
<button> | Defines a clickable button | |
<datalist> | Specifies a list of pre-defined options for input controls | |
<output> | Defines the result of a calculation |
The <fieldset> element is used to group related data in a form.
The <legend> element defines a caption for the <fieldset> element.
First name and Last name are part of the same fieldset
Personalia is the legend
The datalist element specifies a list of pre-defined options for an input element.
Note: The datalist tag is not supported in Safari prior version 12.1.
Here is a list of some common input restrictions:
Attribute | Description |
---|---|
checked | Specifies that an input field should be pre-selected when the page loads (for type="checkbox" or type="radio") |
disabled | Specifies that an input field should be disabled |
max | Specifies the maximum value for an input field |
maxlength | Specifies the maximum number of character for an input field |
min | Specifies the minimum value for an input field |
pattern | Specifies a regular expression to check the input value against |
readonly | Specifies that an input field is read only (cannot be changed) |
required | Specifies that an input field is required (must be filled out) |
size | Specifies the width (in characters) of an input field |
step | Specifies the legal number intervals for an input field |
value | Specifies the default value for an input field |
The list attribute refers to a datalist element that contains pre-defined options for an input element.
<form> <label for="label_id">[your label]</label> <input type="your_type (text, checkbox, password...)" id="label_id" name=label_id" [your restriction]> <label for="label_id">[your label]</label> <input type="your_type (text, checkbox, password...)" id="label_id" name=label_id" [your restriction]> <input list="list_type" name="list_type"> <datalist id="list_type"> <option value="option_1"> <option value="option_2"> <option value="option_3"> </datalist> <fieldset name="identity"> <legend>Your identity</legend> <label for="yourName">What is your name? </label> <input type="text" name="yourName" id="yourName" required> <label for="yourAge">How old are your</label> <input type="number" min="18" max="140"> </fieldset><input type="radio" id="html" name="fav_language" value="HTML"> <label for="html">HTML</label> <input type="radio" id="css" name="fav_language" value="CSS"> <label for="css">CSS</label> <input type="radio" id="javascript" name="fav_language" value="JavaScript"> <label for="javascript">JavaScript</label> <input type="submit"> </form>
Video: Only MP4, WebM, and Ogg video formats are supported by the HTML standard.
Audio: Only MP3, WAV, and Ogg audio formats are supported by the HTML standard.
<video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
The controls attribute adds video controls, like play, pause, and volume.
To start a video automatically, use the autoplay attribute.
Add muted after autoplay to let your video start playing automatically but muted.
<audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
The controls attribute adds audio controls, like play, pause, and volume.
To start an audio automatically, use the autoplay attribute.
Add muted after autoplay to let your audio start playing automatically but muted.
Plug-ins are computer programs that extend the standard functionality of the browser.
The <object> element is supported by all browsers.
The <object> element defines an embedded object within an HTML document.
The <embed> element is supported in all major browsers.
The <embed> element also defines an embedded object within an HTML document.
<object width="100%" height="500px" data="snippet.html"></object> <object data="audi.jpeg"></object> <embed width="100%" height="500px" src="snippet.html">
<iframe width="100%" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>
Add mute=1 after autoplay=1 to let your video start playing automatically (but muted).
<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1&mute=1"></iframe>
Add controls=0 to not display controls in the video player.