HTML tags are keywords (tag names) surrounded by angle brackets:
<tagname>content</tagname>Some HTML elements do not have a closing tag.
Attributes provide additional information about HTML elements.
<tagname attr-name="value"> content </tagname>
<!-- The filename of the source (src), and the size of the image (width and height)
are all provided as attributes -->
<img src="picture.jpg" width="100" height="110">
<!-- HTML links are defined with the <a> tag. The link address is specified in the
href attribute -->
<a href="http://www.yoursite.com">This is a link</a>Examples
Headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important heading.
The HTML <p> element defines a paragraph.
The <title> tag is required in all HTML documents and it defines the title of the document.
A hyperlink <a> is an element, a text, or an image that you can click on, and jump to another document(page).
The link text does not have to be text. It can be an HTML image or any other HTML element.
<!-- Opens the linked document in a new window or tab -->
<a href="http://www.your_site.com/" target="_blank">Link text</a>
<!-- Opens the linked document in the same frame as it was clicked (default) -->
<a href="http://www.your_site.com/" target="_self">Link text</a>
<!-- Opens the linked document in the parent frame -->
<a href="http://www.your_site.com/" target="_parent">Link text</a>
<!-- Opens the linked document in the full body of the window -->
<a href="http://www.your_site.com/" target="_top">Link text</a>
<!-- Opens the linked document in a named frame -->
<a href="http://www.your_site.com/" target="framename">Link text</a>
<!--Bookmarks -->
<!-- Add an id attribute to any <a> element -->
<a id="tips">Useful Tips Section</a>
<!-- Then create a link to the <a> element (Useful Tips Section) -->
<a href="#tips">Visit the Useful Tips Section</a>
<!-- Or, create a link to the <a> element (Useful Tips Section) from another page -->
<a href="http://www.your_site.com/page.htm#tips">Visit the Useful Tips Section</a>Examples
Image elements do not have a closing tag.
Examples
<!-- Image Syntax -->
<img src="cat.jpg" alt="My cat" width="100" height="100">
<!-- Image in another folder -->
<img src="/images/html5.gif" alt="HTML5 Icon" style="width:128px;height:128px">
<!-- Image Maps -->
<img src="planets.gif" alt="Planets" usemap="#planetmap"
style="width:150px; height:120px">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>Examples
<!-- Links to an alternate version of the document
(i.e. print page, translated or mirror) -->
<link rel="alternate">
<!-- Links to the author of the document -->
<link rel="author">
<!-- Links to a help document -->
<link rel="help">
<!-- Imports an icon to represent the document. -->
<link rel="icon">
<!-- Links to copyright information for the document -->
<link rel="license">
<!-- Indicates that the document is a part of a series, and that the next document
in the series is the referenced document -->
<link rel="next">
<!-- Specifies that the target resource should be cached -->
<link rel="prefetch">
<!-- Indicates that the document is a part of a series, and that the previous
document in the series is the referenced document -->
<link rel="prev">Examples
<!-- Links to a search tool for the document -->
<link rel="search">
<!-- URL to a style sheet to import -->
<link rel="stylesheet">
<!-- The URL of the linked resource/document. -->
<link href="URL">
<!-- A two-letter language code that specifies the language of the linked document -->
<link hreflang="langauge_code">
<!-- The type attribute specifies the Internet media type (formerly known as MIME type)
of the linked document/resource. Complete list of standard media types:
"http://www.iana.org/assignments/media-types/media-types.xhtml" -->
<link type="media_type"> <thead> Groups the header content in a table
<tbody> Groups the body content in a table
<tfoot> Groups the footer content in a table
List items can contain new list, and other HTML elements, like images and links, etc.
Examples
<!-- Unordered List -->
<ul>
<li>The first item</li>
<li>The second item</li>
<li>The third item</li>
<li>
<ul>
<li>The first item</li>
</ul>
</li>
</ul>
<!-- Ordered List -->
<ol>
<li>The first item</li>
<li>The second item</li>
<li>The third item</li>
<li>The fourth item</li>
</ol>
<!-- Description List -->
<dl>
<dt>The first item</dt>
<dd>Description of item</dd>
<dt>The second item</dt><dd>Description of item</dd>
</dl>HTML forms <form> are used to collect user input.
Examples
<!-- Form -->
<form action="your_action_page.php" method="GET" target="_blank" accept-charset="UTF-8"
enctype="application/x-www-form-urlencoded" autocomplete="off" novalidate>
<!-- Form elements -->
</form>HTML forms <form> are used to collect user input.
<button> - Defines a clickable button
<datalist> - Specifies a list of pre-defined options for input
<keygen> - Defines a key-pair generator field (for forms)
<output> - Defines the result of a calculation
Examples
<!-- Form -->
<form action="your_action_page.php" method="GET">
<fieldset>
<legend>Personal information:</legend>
<label for="firstname">First name:</label>
<input type="text" id="firstname" name="firstname" value="Ivan">
<label for="lastname">Last name:</label>
<input type="text" id="lastname" name="lastname" value="Ivonov">
<label for="sex">Sex:</label>
<select name="sex" id="sex">
<option value="male">Male</option>
<option value="famale">Famale</option>
</select>
<label for="description">Description:<label>
<textarea name="description" id="description"></textarea>
<input type="checkbox" id="confirmation" name="description" value="yes">
<label>Confirmation of participation</label>
<input type="submit" value="Submit">
</fieldset>
</form>