HTML Cheat Sheet: A Simple Guide to HTML

Publié le - Dernière modification le

If you are new to HTML you may feel a little in the dark about how to progress forward with any sort of momentum. Even if you are experienced in the realm of HTML, it can be easy to lose track of references. We have created an HTML cheat sheet to help you progress your learning at a rate of knots.  

We recommend you use this cheat sheet as a basis to turn to on how to use and implement frequently used tags. This article contains a large amount of information, so we advise that you come back to it frequently and use it as a reference point you can turn to when you are in need of a deeper understanding of HTML.

This cheat sheet provides additional material that goes into detail and explains the workings of individual tags. This will help you compile a comprehensive resource for HTML as well as understand the mechanics behind the code to help you get ahead in your learning. If you need to decipher any tag in HTML here is another great resource for discovering a tag’s meaning.


1. Document Overview

<html> ... </html> 

The html tag encapsulates the whole HTML document. The HTML tag is the root element displayed at the start and end of an HTML document.


<head> ... </head> 

The head tag captures the head of the HTML page containing the title tags, links to style sheets and scripts, as well as Meta data etc.). 


<title> text </title>

The title tag displays the title of the page. This tag appears in the browser title bar and is similarly used for bookmarking the page. It is also utilized for search engines.


<body> ... </body>

The body tag includes the substance of the HTML document, displaying all the text and imaging on display.


2. Document Info


The base tag identifies a default URL and a default target for all the links in an HTML document. It is a handy tool for pages with several internal links.



The meta tag describes meta data within an HTML document. It explains

additional material about the HTML. Including the date, time, description etc.



The link tag builds connections to an external style sheet, other outside pages and documents.


<style> ... </style>

The style tag delineates style information in an HTML document.



The script tag encloses scripting statements or outlets to external script links.


3. Document Structure


These tags <h1> to <h6> express HTML headings. Not surprisingly, h1 is the most important heading, whilst h6 is the least important. They are often segmented to describe different sections of content on an HTML page.



This is the paragraph tag, one of the most frequently used tags in HTML.



The break tag Delineates a line break. It is great for breaking up text that needs to be differentiated on different lines. Note there is no end tag for a line break because it is empty.



The div tag Indicates a division in an HTML document.



The span tag is used to assemble inline-elements of an HTML page. It is most commonly utilized for collectively combining styling elements. 



The horizontal rule tag is a nifty addition that notifies a change in subject of a page.


4. HTML5 Tags

With the introduction of HTML5 new tags have been introduced which have become very common and a crucial part of any HTML cheat sheet.



The article tag defines an article within a document.



The aside tag outlines content within a document sidebar.



The bdi tag isolates parts of the text, enabling shaping of text in different directions.



The details tag labels supplementary info that the user can view or hide.



The dialog tag identifies a dialog window.



The figure tag is an autonomous content extension that includes graphics, images, charts, diagrams etc.



The fig caption tag uses the <figure> element to describe the figure, which is more often than not an image.



The footer tag naturally shows the footer for a document or section.



Likewise the header tag shows the header for a document or section.



The main tag articulates the main content of an HTML page.



The mark tag that shows a measure of emphasised marked text within the content.



The menuitem tag is a context menu with different elements that the user can summon from a popup menu.



The meter tag is a gauge that describes a scalar measurement within an identified series.



The nav tag expresses navigation links for the user.



The progress tag unsurprisingly shows the development of a task.



The rp tag denotes text that does not sustain ruby annotations.



The rt tag is a description of characters in East Asian typography.



The ruby tag displays a ruby annotation for East Asian Typography.



The section tag defines blocks in a document that could be any of chapters, titles, headers, footers etc.



The summary tag is a detectable heading for <details> elements.



The time tag naturally expresses time and date.



A word break tag that denotes a line-break inside the content.


5. Formatting


(a)Text Formatting



The strong tag is known as a phrase tag that expresses key text. It is often highlighted in bold by browsers to convey its importance.



The b tag is an alternative tag to generate bold text drawing attention to text. It is for text, words and phrases not as accentuated as the strong tag above.



The font tag is an old method to denote size, space and color of text, which is now obsolete in HTML5.



This abbreviation that helps indicate abbreviations, whilst concurrently allowing the full form to be accessible. E.g. <abbr title=”UnitedNations”>UN</abbr>



The acronym tag is not supported in HTML5 but holds a similar effect to the abbreviation tag.



The q tag defines a short quotation.



The sub tag denotes subscript text that is smaller and placed half a line lower than prior text.



The sup tag denotes superscript text. Converse to the sub text it appears half a line higher than the prior text, again in a smaller size.



The tt tag is no longer supported in HTML5. It is an old tag, denoting typewriter text.



This is the emphasising tag stressing importance of phrases or words and is often displayed in italics.



The I tag is an alternative way to create text in italics.



the address tag displays contact info of the owner/author of the page.



The definition tag is used to mark up the important command of a term.



The code tag is a phrase tag delineating a portion of computer code that is usually mono-spaced.



The strike tag is not supported in HTML5 but denotes strikethrough text.



The site tag is a reference point for information useful for titles, quotes, annotations and statements in a document.



The pre tag is preformatted text in mono-space that maintains spaces and line breaks.



The del tag denotes deleted text from a document.



The insert tag shows text that incorporated into a document.



The small tag is used for expressing smaller text. It also has a dual meaning under HTML5, indicating information that may be invalid, inaccurate or irrelevant.



The blockquote tag identifies a section of text usually quoted from an alternative source.



The bdo tag is a Bi-directional override, which overrides the text trend.


(b) links formatting


<a href=””>...</a>

This tag is an anchor text for hyperlink


<a href=”mailto:”>...</a>

This tag is a link that draws an outgoing message to a particular email address or



<a href=”tel://###-###”>...</a>

This tag is a useful link that allows numbers to be clicked on. It is growing in popularity because of its handiness for mobile users.


<a name=”name”>...</a>

This tag is an anchor transporting users to particular document elements.


<a href=”#name”>...</a>

Similar to above, this tag transports users to div elements.


(c) Imaging formatting


<img />

This tag is quite simply to show images.



This tag shows the URL of the image.



This tag displays alternative text with the function of clarifying image substance and content to users.



This tag is the capability to denote height in percentage or pixels.



This tag is the capability to denote width in percentage or pixels.



This tag identifies image alignment relative to text on the page.



This tag denotes the border width.



This tag shows spacing above and below the image.




This tag, as above, shows spacing above and below image.



The map tag allows you to display to users that the image is clickable.


<map name=””>...</map>

This tag denotes the name of the map connected amid the image and the map.


<area />

The area tag denotes the area of the image map.


(d) Lists Formatting



This tag defines an ordered list that is either numbered or lettered.



This tag also denotes a list but unordered without any particular order or

importance, usually bullet pointed.



This tag denotes a list item, which can be numbered, lettered or bulleted.



This is a descriptive list tag, usually earmarked for list items that require definitions.



This tag specifically labels a term name within a descriptive list.



This tag describes a name in the description list.


(e) Forms – formatting and attributes



This tag creates an HTML form.



This form action URL tag stipulates where information is to be sent when a user

submits a form.



The method tag commands how the data is sent.



This tag commands how the data is to be encoded when it is sent back to

the server.



The autocomplete tag is a nifty addition commanding whether a form should have autocomplete.



This tag commands whether to validate a form upon submission



This tag detects the character encodings of form submissions.



The target tag instructs where to show form response following submission.



The fieldset tag locates the collection of all fields on the form.



A simple field label tag, directing the user what info to enter.



The legend tag denotes a caption for the <fieldset> element.


<input />

The input tag is an empty element, identifying the particular type of field information to obtain from a user.


Input type attributes



The type tag identifies the field input type and usually include checkbox, text, passwords and date/time.



The name tag shows the name of the form.



The value tag shows the input field information.



The size tag describes the input element width.



The maxlength tag displays the greatest input element character numbers permissible.



The required tag ensures the <input> element is entirely completed before users send the form.



The step tag pinpoints the legal number intervals for an input field.



The width tag denotes the pixel width of an <input> element.



The height tag denotes the pixel height of an <input> element.



The placeholder tag aids the user by explaining the value of the <input> element.



The pattern tag shows a regular expression as a reference for the <input> element, ensuring users submitted accurate information.



The min tag displays the smallest value permissible for every <input> element.



The max tag displays the largest value permissible for every <input> element.



The autofocus tag ensures the <input> element is focussed after loading.



The disabled tag deactivates an <input> element on the form.



This tag identifies a big text input for lengthier messages.



The select tag shows a drop-down box for users to choose from a number of selections.


Select attributes



The name tag shows the name of a drop down combination box.



The size tag identifies the amount of drop-down alternatives.



The multiple tag is provision for numerous selections to be made simultaneously.



As the name suggest the required tag necessitates a value is chosen already before a user can submit a form.



The autofocus tag ensures the drop-down list is focussed routinely after loading.



The optgroup tag identifies the whole grouping of options.



The option tag stipulates one of the presented selections in the drop-down list.


Option attributes



The value tag clarifies the option value obtainable for selection



The selected tag outlines the default selection



The button tag stipulates the clickable button for users to submit options.


(f) Tables and Formatting



The table tag stipulates and encloses all table information.



The caption tag delineates a table caption.



The thead tag is used to collect header content within an HTML table.



The tbody tag is used to collect body content in an HTML table.



The tfoot tag is used to collect footer content within an HTML table.



The tr tag identifies a row in an HTML table.



The th tag identifies a header cell in an HTML table.



The td tag identifies a standard cell in an HTML table.



The colgroup tag stipulates a group of columns in a table.


6. Objects and iFrames



The object tag delineates an embedded object, which could be in a variety of file types.



The height tag defines the height of the object in pixels.



The width tag defines the width of the object in pixels.



The type tag defines what media type the data encompasses.



This uesmap tag is the label within <object> for a client-side image.



The iframe tag denotes an inline frame.


iFrame Attributes



The name tag is the label of the <frame>



The src tag shows the URL origin of the initial document to embed within the <frame>.



The srcdoc tag defines HTML matter that is presented inside the <frame> in the existing page.



the width tag defines the width of the <frame>.


<param />

the param tag is a customization tag attaching extra parameters to iframe content.



The embed tag actions as a vessel for external an external application or extra plug-in.


Embed Attributes



the height tag defines the height of the embedded content.



The width tag defines the width of the embedded content



The src tag is the URL origin of the external file being embedded.



In this instance, the type tag defines what media type of embedded content to incorporate.



We hope that you find this resource useful. If you have any other HTML cheats to add, particularly relating to HTML5, please add them to the discussion below.

Publié 27 juin, 2017


Copywriter, Content Writer, Proofreader, Marketer.

Dunja is the Content & Email Manager at Freelancer HQ (Sydney). She is an Oxford graduate, and is the mother of a pet parrot called DJ Bobo.

Article suivant

Angular 2 for Beginners: A Tutorial