0% found this document useful (0 votes)
4 views

HTML Cheatsheet

Uploaded by

Gaurav Mittal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

HTML Cheatsheet

Uploaded by

Gaurav Mittal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

HTML Tags

Document Structure Tags

1. <!DOCTYPE html>: Specifies the document type.


2. <html>: Encloses the entire HTML document.
3. <head>: Contains meta-information and links to scripts and
stylesheets.
4. <body>: Contains the content of the web page.

Metadata Tags

1. <title>: Sets the title of the web page.


2. <meta>: Provides metadata such as character set, author,
and viewport settings.
3. <link>: Links external resources like stylesheets.

Text Formatting Tags

1. <p>: Paragraph.
2. <h1>, <h2>, <h3>, <h4>, <h5>, <h6>: Headings.
3. <strong>: Strong emphasis (typically bold).
4. <em>: Emphasis (typically italic).
5. <br>: Line break.
6. <hr>: Horizontal rule.

List Tags

1. <ul>: Unordered list.


2. <ol>: Ordered list.
3. <li>: List item.
Hyperlink and Media Tags

1. <a>: Anchor (used for links).


2. <img>: Image.
3. <audio>: Audio content.
4. <video>: Video content.

Form Tags

1. <form>: Form.
2. <input>: Input field.
3. <textarea>: Text area.
4. <button>: Button.
5. <select>: Dropdown list.
6. <option>: Options within a <select> or <datalist>.

Table Tags

1. <table>: Table.
2. <tr>: Table row.
3. <td>: Table data cell.
4. <th>: Table header cell.
5. <thead>: Table header group.
6. <tbody>: Table body group.
7. <tfoot>: Table footer group.

Semantic Tags

1. <header>: Header section.


2. <footer>: Footer section.
3. <article>: Article.
4. <section>: Section.
5. <nav>: Navigation.
6. <aside>: Sidebar content.
Inline Elements

• <a> <map>
• <abbr> <object>
• <acronym> <output>
• <button> <label>
• <br> <kbd>
• <big> <tt>
• <bdo> <samp>
• <b> <script>
• <cite> <select>
• <code> <small>
• <dfn> <time>
• <i> <span>
• <em> <strong>
• <img> <sub>
• <input> <textarea>
• <sup>

Block-level Elements

• <h1>,<h2>,<h3>,<h4>,<h5>,<h6> - Headings
• <p> - Paragraphs
• <hr> - Horizontal rule
• <address> - Address information
• <article> - Article content
• <aside> - Sidebar content
• <blockquote> - Block quotations
• <canvas> - Drawing area
• <dd> - Description in a description list
• <div> - Generic container
• <dl> - Description list
• <dt> - Term in a description list
• <fieldset> - Group of related form elements
• <figcaption> - Caption for a figure
• <figure> - Image or media with a caption
• <footer> - Footer of a section or page
• <form> - HTML form
• <header> - Header of a section or page
• <li> - List item
• <main> - Main content of a document
• <nav> - Navigation links
• <noscript> - Alternate content when JavaScript is not
enabled
• <ol> - Ordered list
• <ul> - Unordered list
• <pre> - Preformatted text
• <section> - Standalone section in a document
• <table> - Table
• <video> - Video content

HTML Input Types

Input Type Description


text Allows the user to type a single line of text.
password Allows the user to type a password.
Represents a button that, when pressed, submits the
submit
form.
Represents a button that, when pressed, resets all the
reset
form controls to their initial values.
Represents an option in a set of options that are
radio
mutually exclusive with each other.
Represents an option in a set that may be selected
checkbox
independently of other options.
button Represents a clickable button.
Input Type Description
color Allows the user to select a color.
date Allows the user to select a date.
datetime- Allows the user to select a date and time with no time
local zone.
email Allows the user to enter an email address.
Allows the user to select one or more files from their
file
device storage.
Represents a value that is not displayed but is
hidden
submitted to the server.
image Defines an image that acts as a submit button.
month Allows the user to select a month and year.
number Allows the user to enter a number.
range Allows the user to select a number from a range.
search Allows the user to enter a search query string.
tel Allows the user to enter a telephone number.
time Allows the user to select a time.
url Allows the user to enter a URL.
week Allows the user to select a week.
Video & Audio Tags

<video src="video.mp4" controls></video>

Attributes for <video> Tag

• src: Specifies the path to the video file.


• controls: Adds video controls, like play, pause, and volume.
• autoplay: Automatically starts playing the video when the
page loads.
• loop: Repeats the video once it ends.
• muted: Mutes the video by default.
• poster: Specifies an image to be displayed before the
video starts playing.
• width and height: Specifies the dimensions of the video.

<audio src="audio.mp3" controls></audio>

Attributes for <audio> Tag

• src: Specifies the path to the audio file.


• controls: Adds audio controls, like play, pause, and volume.
• autoplay: Automatically starts playing the audio when the
page loads.
• loop: Repeats the audio once it ends.
• muted: Mutes the audio by default.
• preload: Specifies if and how the audio should be loaded
when the page loads ('auto', 'metadata', 'none').

You might also like