HTML Cheatsheet
HTML Cheatsheet
HTML Cheatsheet
HTML
Cheat Sheet
>
by Zahid Khaliq
0 | HTML Cheat Sheet
Table of Content
Document Summary
01
Document Information
Document Structure
Text Formatting 02
Links
03
Images
Lists
Forms
04
Input Type Attributes
Select Attributes
Option Attributes
05
Table Formatting
Objects & iFrames
iFrame Attributes
06
Embed Attributes
HTML5 New tags
Collective Character Objects 07
1 | HTML Cheat Sheet
For the web developers, it is crucial to be proficient in HTML, and while HTML is not the most
difficult to get accustomed to, one can still manage to forget all the nooks and crannies is has to
offer. A good solution, therefore, is to always have a cheat sheet at hand, helping you in your most
troubling moments.
</body>
</html>
2 | HTML Cheat Sheet
Example border=””
<p><strong>Bold text</strong> Regular Text & Specifies border thickness of the image. If
<em>some words in italic</em> regular text not mentioned, default to 0.
again.</p> <map> … </map>
<blockquote>Anyone who has never made a Denotes an interactive (clickable) image.
mistake has never tried something new. <cite>- <map name=””> … </map>
Albert Einstein</cite></blockquote> Name of the map associated between the
image and the map.
<p>A code snippet: <code>write some code in
this tag</code></p> <area/>
Specifies image map area
Links shape=””
Shape of the image.
<a href=”#”> … </a>
Anchor tag, Primarily used to creates a Example
hyperlink to web pages, files, email addresses,
locations in the same page, or anything else a <img src=”filename.jpg” width=”100”
URL can address. height=”80” alt=”filename”
● Sections of a page with document usemap=”#filename”>
fragments <map name=”filename”>
● Specific text portions with text fragments
● Telephone numbers with tel: URLs <area shape=”rect” coords=”0,0,60,100”
href=”selectarea1.html” alt=”selectarea1”>
● Email addresses with mailto: URLs
● SMS text messages with sms: URLs <area shape=”rect” coords=”90,58,3”
href=”selectarea2.html” alt=”selectarea2”>
Images <area shape=”circle” coords=”150,58,8”
href=”selectarea3.html” alt=”selectarea3”>
<img/> </map>
A tag to display images in the webpage.
src=”url”
The url or path where the images is located on
your drive or on the web.
alt=”text”
The text written here is displayed when user
hovers mouse over the image. Can be used to
give additional details of the image.
height=””
Specifies image height in pixels or percentage.
width=””
Specifies image width in pixels or percentage.
align=””
The relative alignment of the image. Can
change with changes to other elements.
4 | HTML Cheat Sheet
Lists enctype=””
Only for POST method, this dictates the data
<ol> … </ol> encoding scheme to be used when form is
Tag for ordered or numbered list of items. submitted.
<ul> … </ul> autocomplete
Contrary to the above tag, used for unordered Determines if the form has autocomplete is
list of items. enabled.
<li> … </li> novalidate
Individual item as part of the list. Determines whether the form should be
<dl> … </dl> validated before submission.
Represents a description list. accept-charsets
Determines character encoding when form
<dt> … </dt>
is submitted.
Specifies a term in a description or definition
list.
target
After submission, the form response is
<dd> … </dd>
displayed werever this refers to, usually has
Provides the description, definition, or value
the following values: _blank, _self, _parent &
for the preceding term.
_top
Example <fieldset> … </fieldset>
<ol> Identifies the group of all fields on the form.
<li>January</li> <label> … </label>
<li>February</li>
This is used to label a field in the form.
<li>March</li>
</ol> <legend> … </legend>
This operates as a caption for the <fieldset>
<ul> element.
<li>April</li>
<input />
<li>May</li>
<li>June</li> This tag is used to take input from the user.
</ul> Input type is determined by a number of
attributes.
<dl>
<dt>Origin</dt> Input Type Attributes
<dd>Japan</dd>
</dl> type=””
Forms Determines which type of input (text,
dates,password & number) is requested
<form> … </form> from the user.
The parent tag for an HTML form. name=””
action=”url” Specifies the name of the input field.
The URL listed here is where the form data will value=””
be submitted once user fills it. Specifies the value contained currently in the
method=”” input field.
It specifies which HTTP method (POST or GET)
would be used to submit the form.
5 | HTML Cheat Sheet
size=”” required
Determines the input element width(number Specifies whether choosing an options is
of characters) necessary.
maxlength=”” autofocus
Specifies the most input field characters Specifies that a drop down list automatically
allowed. comes into focus after a pge loads.
required <option> … </option>
Makes an input field compulsory to be filled. Tag for listing individual items in the list of
width=”” options.
Determines the width of the input element.
Option Attributes
height=””
Determines the height of the input element. value=””
placeholder=”” The text visible to the user for any given
Can be used to give hints to the user about the option.
nature of the requested data. selected
pattern=”” Determines which option is selected by
Specifies a regular expression, which can be default
look for the pattern in the user’s text. <button> … </button>
min=”” Tag for creating a button for form
The minimum value allowed for an <input>. submission.
max=””
Example
The maximum value allowed for an <input>.
autofocus <form actions=”form_submit.php”
Forces focus on the <input>, when webpage method=”post”>
loading is completed. <fieldset>
disabled <legend>Bio:</legend>
First name: <br>
Disable the <input>, user cannot enter data. <input type=”text” name=”first-name”
<textarea> … <textarea/> value=”John” placeholder=”write your
For longer strips of input, can be used to get first name” > <br>
Last name: <br>
multi sentence text from the user
<input type=”text” name=”last-name”
<select> … <select/> vale=”Smith” placeholder=”write your
This tag specifies a list of options which the last name”> <br>
user can choose from. Favourite Sport: <br>
<select>
Select Attributes <option
value=”soccer”Soccer</option>
name=”” <option value=”golf”Golf</option>
</select>
The name of a particular list of options.
<textarea name=”descrip”></textarea>
size=”” <input type=”submit” value=”submit”>
Total number of options given to the user. </fieldset>
multiple </form>
States whether user can choose multiple opts.
6 | HTML Cheat Sheet
Telegram
@codehype
Join Telegram for
FREE Coding
Resources
CodeHype