HTML5 Web Design Basics
HTML5 Web Design Basics
HTML5
GROUP 7
MEMBERS:
It is easy to learn
and easy to use.
It is platform-
independent. Images, videos, and
audio can be added
HTML
to a web page.
Hypertext can be
added to the text.
It is a markup
language.
2 HTML Elements and Tags
<!DOCTYPE html> – This is the document type declaration (not technically a tag). It declares
a document as being an HTML document. The doctype declaration is not case-sensitive.
<html> – This is called the HTML root element. All other elements are contained within it.
•<head> – The head tag contains the “behind the scenes” elements for a webpage. Elements
within the head aren’t visible on the front end of a webpage. HTML elements used inside the
<head> element include:
<style> – This HTML tag allows us to insert styling into our web pages and make them
appealing to look at with the help of CSS.
3 HTML Page Structure
<title> – The title is what is displayed on the top of your browser when you visit a website and
contains the title of the webpage that you are viewing.
<base> – It specifies the base URL for all relative URL’s in a document.
<noscript> – Defines a section of HTML that is inserted when the scripting has been turned
off in the user’s browser.
<script> – This tag is used to add functionality to the website with the help of JavaScript.
3 HTML Page Structure
<meta> – This tag encloses the metadata of the website that must be loaded every time the
website is visited. For eg:- the metadata charset allows you to use the standard UTF-8
encoding on your website. This in turn allows the users to view your webpage in the language
of their choice. It is a self-closing tag.
<link> – The ‘link’ tag is used to tie together HTML, CSS, and JavaScript. It is self-closing.
<body> – The body tag is used to enclose all the visible content of a webpage. In other
words, the body content is what the browser will show on the front end.
3 HTML Page Structure
An HTML document can be created using an HTML text editor. Save the text file using the
“.html” or “.htm” extension. Once saved as an HTML document, the file can be opened as
a webpage in the browser.
EXAMPLE: This example illustrates the basic structure of HTML code.
4 Why learn HTML?
It is a simple markup language.
Its implementation is easy.
Helps in developing
fundamentals about
web programming.
HTML
HTML is a markup language used by the browser to manipulate text, images, and other
content, in order to display it in the required format. HTML was created by Tim Berners-Lee in
1991. The first-ever version of HTML was HTML 1.0, but the first standard version was HTML
2.0, published in 1995. Currently, we are using HTML5, which is the latest and most recent
version of HTML.
2014
1997
1993 2012 HTML
5
1995 HTML HTML
HTML 3 1999 4.01
1
HTML
2 HTML
4
ADVANTAGES DISADVANTAGES
With the increasing movement to keep structure and style separate, some styling
elements were removed. Also tags with accessibility issues or saw little use were also
removed. These following elements should no longer be used in HTML code:
<acronym>, <applet>, <basefont>, <big>, <center>, <dir>, <font>, <frame>,
<frameset>, <noframes>, <strike>, and <tt>.
B HTML BASIC
EXAMPLES
1 DIFFERENCE BETWEEN HTML AND CSS
HTML (HyperText Markup Language) and HTML is the standard markup language
CSS (Cascading Style Sheets) are the used to create web pages. It structures the
foundational technologies for creating web content by using elements such as
pages. HTML provides the structure, while headings, paragraphs, lists, links, images,
CSS defines the style and layout. HTML is and more. HTML elements are the building
used along with CSS and Javascript to blocks of web pages, allowing developers
design web pages. to embed multimedia, create forms, and
design the overall layout.
2 Features of HTML
HTML provides the HTML is used to add HTML is used to create HTML is used to create
basic structure of a various types of content links between different forms that allow users
webpage, defining the to a webpage, including pages and websites, to input data, such as
layout and hierarchy of text, images, videos, allowing users to contact information or
content using elements and audio. navigate the web. search queries.
such as headings,
paragraphs, and lists.
Example: In this example, we will see the basic structure of an HTML
document.
3 CSS (Cascading Style Sheets)
CASCADING INTEGRATION
The “C” in CSS stands for “Cascading”,
HTML and CSS are often used
which means that styles can be inherited
together, with CSS being used to style
and overridden based on the order of the
style rules and the specificity of the the elements defined in HTML.
selectors.
6 DIFFERENCE BETWEEN HTML AND CSS
The table below shows the Difference between HTML and CSS:
HTML CSS
• HTML is a markup language used to define a structure • CSS is a style sheet language used to style the web
of a web page. pages by using different styling features.
• It consists of tags inside which text is enclosed. • It consists of selectors and declaration blocks.
• HTML doesn’t have further types. • CSS can be internal or external depending upon the
• We cannot use HTML inside a CSS sheet. requirement.
• HTML is not used for presentation and visualization. • We can use CSS inside an HTML document.
• HTML has comparatively less backup and support. • CSS is used for presentation and visualization.
• HTML doesn’t allow animations and transitions. • CSS has comparatively higher backup and support.
• HTML files are saved with .htm or .html extension. • CSS allows animation and transitions which helps to
improve the UI.
• CSS files are saved with .css extension.
7 WHAT ARE PHYSICAL TAGS IN HTML?
1 2 3 4
They are extremely They are used to Physical Text Styles Physical Styles are
straightforward. highlighting important indicate the specific rendered in the same
sentences. type of appearance for manner by all browsers.
a section e.g., bold,
italics, etc.
9 Example of Physical Tags
TAGS MEANING PURPOSE
Bold increases the importance of the text because bold tag convert the text into bold size.
<b> Bold HTML <b> tag acts as a presentation tag used to markup written text as a bold format. If we want to
display plain text in bold format you can use text between <b>sentence</b> tag.
Big tag increase the font size by 1 (Note: You can not use the big tag in HTML 5)
The <big> tag is used to make the text one size bigger i.e small to medium, medium to large, and
<big> Big
large to x-large but the <big> tag will not make the font size larger than the browser’s maximum
font-size.
9 Example of Physical Tags
TAGS MEANING PURPOSE
A small tag defines the small text, and it is used while writing copyright.
<small> Small The <small> tag is used to make the text one size smaller i.e x-large to large …. small but <small>
tag will not make the font-size smaller than the browser’s minimum font-size.
It is an editing markup that tells the reader to ignore the text passage.
<strike> Strike-through Strike tag defines Strike through sentences. The strike tag makes the horizontal line over the text
which represents that this given text is not for reading ignore it.
HTML uses predefined tags that tell the browser how to display the
content. Tags are nothing but some instructions that are enclosed in
angle braces(i.e., <>). Tags are used in many places of the webpage but
many users are often confused about some tags whether it is a
container or an empty tag. They get this confusion because they don’t
know for what tag there should be an ending tag along with the opening
tag or not. There are two types of tags in HTML:
Table of Content
• Container tags
• Empty Tags
10 CONTAINER AND EMPTY TAGS IN
HTML
• Container tags
Container tags are generally divided into three parts, i.e., opening tag, content(which will
display on the browser), and closing tag. In the content part, they can also contain some
other tags. These opening and closing tags are used in pairs which are start tag and end
tag, which are often called ON and OFF tags.
If you forget to close the container tag, the browser applies the effect of the opening tag
until the end of the page. So be careful while working with container tags. The majority of
tags present in HTML are container tags.
Syntax:
<tag_name> ...</tag_name>
Some commonly used container tags are:
1. Essential Tags: Following tags are used to create the structure of the webpage:
• <html>….</html>: This marks the beginning and ending of the webpage also it tells that
the document is an HTML document. This contains all other tags in between these tags
which are considered for making a webpage.
• <head>…</head>: This tag is used to define the head part of the document which
contains the information related to the webpage.
• <title>…</title>: This tag stores the description of the web page, whatever given in these
tags appears on the tab name while opened by the browser. It is described in the head
tag.
• <body>….</body>: This tag is used to display all the information or data, i.e, text,
images, hyperlinks videos, etc., on the webpage to the user.
9. Script tag: Following tag is used to add JavaScript code to the webpage:
<script>…</script> : This contains the javascript code that adds interactivity to the
webpage.
10. Lists: Following tags are used to write data in the form of ordered and unordered lists:
• <ol>…</ol>: This tag is used to create ordered lists.
• <ul>…</ul>: This tag is used to create unordered lists.
• <li>…</li>: This tag is used to add list items.
10 CONTAINER AND EMPTY TAGS IN HTML
• Empty Tags
The tags that do not contain any closing tags are known as
empty tags. Empty tags contain only the opening tag but they
perform some action in the webpage. Some commonly used
empty tags are as:
Syntax:
<tag_name>
Empty Tags Description
This is mainly used with forms to take the input from the user and we can
<input> also define the type of the input.
When we store our CSS in an external file this can be used to link external
<link> files and documents to the webpage and it is mainly used to link CSS files.
Contains all metadata of the webpage. Metadata is the data about data and
<meta> is described in the head tag.
<html lang="en">
<head>
<!--Meta data-->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible"
content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<!--The description written on title tag get appeared as browser tab name-->
</head>
<body>
<!--Headings-->
<hr>
<p> Geeks for geeks is a computer science portal for geeks. </p>
<hr>
Adding a background image to your HTML page can enhance the visual appeal
and provide a more immersive experience for your website visitors. This
process involves embedding an image behind your webpage content. You can
do this by using the background attribute in HTML tags or the style tag, either
inline or in an external stylesheet. This allows you to specify the image URL
and control its placement and appearance.
Table of Content
1. Using a style Attribute
2. Using The Background Attribute
3. Using the background-image property
Examples of adding background images in HTML
Syntax:
<div style = "background-image: url('Image_name.extension');">
Example: In this example we sets the background image of the body using the style attribute, specifying
the image URL and preventing repetition.
<!DOCTYPE html>
<html>
<head>
<title>By using style attribute</title>
</head>
<body
style="background-image: url(
'https://media.geeksforgeeks.org/wp-content/uploads/20240412161651/using-style-
attribute.jpg');
background-repeat: no-repeat;"
>
</body>
</html>
Output:
Syntax:
body background="image_name.image_extension">
Example: In this example we sets the background image of the body using the deprecated background
attribute and specifies no repetition using inline CSS.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Background Image</title>
</head>
<body background=
"https://media.geeksforgeeks.org/wp-content/uploads/20240412161651/using-style-attribute.jpg"
style="background-repeat: no-repeat;">
</body>
</html>
Output:
Syntax:
background-image: url('url')
Example: In this example we sets the body background image using CSS background-image property.
The image URL is provided within the style block, with background-repeat set to no-repeat.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Background Image</title>
<style>
body {
background-image: url(
"https://media.geeksforgeeks.org/wp-content/uploads/20240415102919/
UsingBackgroundImageProperty.webp");
background-repeat: no-repeat;
}
</style>
</head>
<body>
<!-- Your content here -->
</body>
</html>
Output:
To define a list in HTML5 we can use the HTML <li> tag. But there are two types
of listing in HTML. One is an ordered list and another one is an unordered list.
For ordered we can use HTML <ol> tag and for the unordered list, we will use
the HTML <ul> tag.
Also, we can change the list type, for that, you can check the below articles.
• HTML <li> type Attribute
• HTML <ol> type Attribute
• HTML <ul> type Attribute
Ordered list: It defines a list of items in which the order of item matters. An ordered list is
also called a number list. The list items are enclosed within <ol> and </ol>tags. The
ordering is given by numbering scheme, using Arabic numbers, letters or roman
numerical.
Syntax:
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
Unordered list: It is used for items in which the ordering is not specific. An unordered list
also called bulleted list. The list is defined using the <ul> and <ul/>tags. Each time in the
list is defined using the <li> tag.
Syntax:
<ul>
<li>List item 1</li>
<li>List item 2</li>
</ul>
Example: The following code demonstrates both the ordered list and un-ordered list.
HTML
<!DOCTYPE html>
<html>
<body>
<h1>GeeksforGeeks</h1>
<ol>
<li>Geeks</li>
<li>Sudo</li>
<li>Gfg</li>
<li>Gate</li>
<li>Placement</li>
</ol>
<ul>
<li>Geeks</li>
<li>Sudo</li>
<li>Gfg</li>
<li>Gate</li>
<li>Placement</li>
</ul>
</body>
</html>
Output:
<head>
• details }
color: green;
font-weight: bold;
• figcaption table,
tr,
td {
• figure
border: 1px solid black;
}
th {
• footer }
font-weight: bold;
color: red;
• form
</style>
</head>
<body>
• header <article>
<h1>GeeksforGeeks</h1>
<p>A Computer Science Portal for Geeks</p>
• main
</article>
<table>
<tr>
<th>head1</th>
• mark </tr>
<tr>
<th>head2</th>
• nav </tr>
<td>A</td>
<td>0</td>
<tr>
• table </tr>
<td>B</td>
<td>1</td>
• section </table>
</body>
</html>
Output:
Following is the list of some semantic elements:
• Article - Represents a self-contained piece of
content that could stand alone, such as a blog • Header - Represents introductory content,
post, news article, or forum post. typically a group of introductory or
• Aside - Contains content that is tangentially navigational aids.
related to the content around it, such as • Main - Specifies the main content of the
sidebars or call-out boxes. document, excluding headers, footers, and
• Details - Defines additional details that the navigation.
user can view or hide • Mark - The <mark> element is used to
• Figcaption - Provides a caption or legend for highlight text that is relevant or important to
the content of the <figure> element. the user's current context or for reference
• Figure - Encapsulates a unit of content, such
purposes.
as an image with a caption, that is referenced in
• Nav - Defines a set of navigation links.
the main flow of the document.
• Table - The <table> element is used to
• Footer - Represents the footer for its nearest
sectioning content or the root element. create a table, which is a structured set of
• Form - The <form> element represents a data made up of rows and columns.
section of a document that contains interactive • Section - Represents a standalone section
controls for submitting information to a web of content that is thematically related.
server.
14 DIFFERENCE BETWEEN SEMANTIC AND NON-SEMANTIC ELEMENTS
NON-SEMANTIC ELEMENTS
text }
font-weight: bold;
</style>
</head>
<body>
<div>
<span>GeeksForGeeks</span> <br>
A computer science portal for geeks
</div>
</body>
</html>
Output:
15 Difference between semantic and non-semantic elements
SEMANTIC NON-SEMANTIC
• They have meaning • They don’t have meaning
• They describe how the content • They can contain anything
within them is supposed to • The ‘class’ attribute can be
behave used to work with their
• They have specific attributes for structure
their structure
15 HTML COLOR PICKER
HTML Color Basics
hsl(348.5, 83.3%,
Crimson #DC143C rgb(220, 20, 60)
47.1%)
hsl(146.5, 50.7%,
Sea Green #2E8B57 rgb(46, 139, 87)
36.3%)
hsl(197.8, 71.4%,
Sky Blue #87CEEB rgb(135, 206, 235)
71.6%)
hsl(174.7, 72.7%,
Turquoise #40E0D0 rgb(64, 224, 208)
55.1%)
hsl(302.2, 59.6%,
Orchid #DA70D6 rgb(218, 112, 214)
64.9%)
<object> element in HTML5 is used to link any external files and resources in the form of
any image or any nested linked webpages or content or any plugin that can do the same
work.
Syntax:
object name="name"></object>
Initially <object> is designed to embed the different applications and browser plugins
within it, which is mostly used to extend the usability of browsers.
The attributes that can be passed within this element:
Attribute Value Description
type media_type It specifies the media type of data specified in the data attribute.
It indicates that the resource should be embedded only if the value of the type attribute matches with the type of
typemustmatch boolean
resource provided on the data attribute.
hspace pixels It specifies the white space on the left and right sides of the object.
vspace pixels It specifies the white space on the top and bottom of the object.
form form_id It specifies the form id to which the object element belongs to.
Example: Here is the sample code which has objected to link image, video, and any HTML link of some
other webpage:
HTML
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<body>
<label>1.Image Example</label><br>
<object data=
"https://media.geeksforgeeks.org/wp-content/uploads/20210214171643/logo.png"
width="400"
height="300"
border="2"
name="obj1"></object><br><br>
<label>2.Webpage Example</label><br>
<object data="https://www.geeksforgeeks.org/"
width="400"
height="300"
border="2"
name="obj2"></object><br><br>
<label>3.Video Example</label><br>
<object data=
"https://media.geeksforgeeks.org/wp-content/uploads/20210318163839/v.mp4"
width="400"
height="300"
border="2"
name="obj3"></object>
</body>
</html>
17 HOW TO ADD SPACE BETWEEN ELEMENTS?
In this article, we will know how to add space between elements in the
HTML table, along with understanding its implementation through the
examples. We can use normal CSS to make changes in the table, where
we will be using border property to give spacing between different body
elements.
No prior and deep knowledge is required it is just basic CSS and HTML
tricks.
Note: Only thing to be noted is that there must be one “tr” tag inside the
tbody tag
Example 1: The code that uses the border-top property to give the spacing between the elements is
given below.
<body>
HTML <table>
<tbody class="tbody">
<!DOCTYPE html>
<html lang="en">
<tr> Output:
<td>GeeksforGeeks</td>
<td>GeeksforGeeks</td>
<head> </tr>
<meta charset="UTF-8"> <tr>
<meta name="viewport" <td>GeeksforGeeks</td>
content="width=device-width, <td>GeeksforGeeks</td>
</tr>
initial-scale=1.0">
</tbody>
<title>Document</title>
<tbody class="tbody">
<style> <tr>
body { <td>GeeksforGeeks</td>
color: #fff; <td>GeeksforGeeks</td>
font-size: 12px; </tr>
} <tr>
<td>GeeksforGeeks</td>
table { <td>GeeksforGeeks</td>
border-collapse: collapse; </tr>
} </tbody>
<tbody class="tbody">
<tr>
table td {
<td>GeeksforGeeks</td> Adding the space between the elements in the table
padding: 5px; <td>GeeksforGeeks</td>
background-color: #093d24; </tr>
} <tr>
<td>GeeksforGeeks</td>
.tbody { <td>GeeksforGeeks</td>
border-top: 25px solid #0f9d58; </tr>
} </tbody>
</style> </table>
</body>
</head>
</html>
Example 2: In the below given example, we have used the ::before selector property, which will help in giving a margin between the tbody
elements, so the code for this is given below. Also, we have used overflow: hidden property in the table to prevent overflow of before element.
<!DOCTYPE html>
<html lang="en">
<body>
<table> Output:
<tbody class="tbody">
<tr>
<head>
<td>GeeksforGeeks</td>
<meta charset="UTF-8">
<td>GeeksforGeeks</td>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> </tr>
<style> <tr>
body { <td>GeeksforGeeks</td>
color: #fff; <td>GeeksforGeeks</td>
font-size: 12px; </tr>
background-color: #f2f2f2; </tbody>
} <tbody class="tbody">
<tr>
<td>GeeksforGeeks</td>
table {
<td>GeeksforGeeks</td>
overflow: hidden; </tr>
border-collapse: collapse; <tr>
position: relative; <td>GeeksforGeeks</td>
} <td>GeeksforGeeks</td>
</tr>
table td { </tbody>
padding: 5px; <tbody class="tbody"> Preventing the overflow of before element using Overflow Property
border: 1px solid #000; <tr>
<td>GeeksforGeeks</td>
background-color: #093d24;
<td>GeeksforGeeks</td>
} </tr>
<tr>
.tbody::before { <td>GeeksforGeeks</td>
content: ""; <td>GeeksforGeeks</td>
margin: 10px; </tr>
} </tbody>
</style> </table>
<title>Document</title> </body>
</head>
</html>
18 HOW TO CREATE A CLICKABLE BUTTON IN HTML?
Syntax:
<button type = "button">
Example: Using HTML <button> type Attribute
<!DOCTYPE html>
<html> Output:
<head>
<title>
How to create a clickable button?
</title>
</head>
<body>
<center>
<p>
<h2>
GeeksForGeeks
</h2>
</p>
<h2>
HTML: How to create a clickable button?
</h2>
</body>
</html>
C HTML LINKS
1 HTML LINKS HYPERLINKS
HTML links, or hyperlinks, connect web pages and are created using the `<a>` tag with the
`href` attribute. They enable users to navigate between pages or resources. Links can be
text, images, or other elements, enhancing web navigation and interactivity. Users can
click on links to navigate between different pages or resources.
Note: A hyperlink can be represented by an image or any other HTML element, not just text.
By default, links will appear as follows in all browsers:
• An unvisited link is underlined and blue
• A visited link is underlined and purple
• An active link is underlined and red
Syntax:
<a href="url">link text</a>
Target Attribute
Attribute Description
_top Opens the linked document in the full body of the window.
In this example we contains a paragraph instructing users to click on the link labeled “GeeksforGeeks,”
which directs to the website “https://www.geeksforgeeks.org”.
<!DOCTYPE html>
<html>
<head>
<title>HTML Links</title>
</head>
<body>
<p>Click on the following link</p>
<a href="https://www.geeksforgeeks.org">
GeeksforGeeks
</a>
</body>
</html>
Output:
<p>
If you set the target attribute to
"_blank", the link will open in a new
browser window or tab.
</p>
<a href="https://www.geeksforgeeks.org"
target="_blank">
GeeksforGeeks
</a>
<p>
If you set the target attribute to
"_self", the link will open in the
same window or tab.
</p>
<a href="https://www.geeksforgeeks.org"
target="_self">
GeeksforGeeks
</a>
2 HTML Cheat Sheet
This HTML Cheat Sheet for Beginners contains helpful code examples and is
designed as a quick reference for those familiar with these languages. From
semantic elements to mobile optimization, we covered all topics. Whether you’re
building a personal blog, an e-commerce site, or a cutting-edge web app, this cheat
sheet has you covered.
What is an HTML Cheat Sheet?
An HTML Cheat Sheet is a reference document summarizing key HTML elements, attributes, and
syntax. It serves as a quick guide for web developers, offering easy access to commonly used tags
and their respective functionalities.
Table of Content
• Main root
• Boilerplate
• Headings
• Container
• Document Information
• Semantic Element
• Text Formatting and Inline Text Semantics
• Lists
• Tables
• Forms
• Multimedia
• Characters and Symbols
• Attributes
Main root
The <html> element represents the root (top-level element) of an HTML document also called the
document element. All other elements must be descendants of this element.
<html> … </html>
BOILERPLATE
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Description of the document -->
<meta charset="UTF-8" />
<title>
<!-- title goes here -->
Geeks For Geeks
</title>
</head>
<body>
<!-- your content goes here -->
Welcome to Geeks for Geeks
</body>
</html>
Main root
Headings
HTML heading tags (<h1> to <h6>) are used to define headings and subheadings on your webpage.
The <h1> tag is typically reserved for the page’s main title, while the others denote subheadings in
descending order of importance.
Used for title generally once per page and has a font size
<h1> <h1>….</h1>
of 2em.
Used for medium sized titles and has a font size of
<h2> <h2>….</h2>
1.5em.
<h3> Used for subsections and has a font size of 1.17em. <h3>….</h3>
<h4> Used for highlighting text with font size of 1em. <h4>….</h4>
<head>
<title>Heading Tags</title>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>GeeksforGeeks</h2>
<h3>GeeksforGeeks</h3>
<h4>GeeksforGeeks</h4>
<h5>GeeksforGeeks</h5>
<h6>GeeksforGeeks</h6>
</body>
</html>
Main root
Container
Container tags in HTML are used to group other elements together. They provide a way to structure
your HTML and apply styles to multiple elements at once. The several container tags in HTML are:
<header> Used to give introductory content about the document. <header>… </header>
<section> Structural HTML element used to group together related elements. <section>… </section>
<aside> Defines some content aside from the content it is placed in. <aside>… </aside>
<footer> Represents a footer for its sectioning root element <footer>… </footer>
Provides contact information for a person, people, or an
<address> <address>..</address>
organization.
Main root
HTML </article> visit us:<br>
<!DOCTYPE html> <!-- main tag starts here --> GeeksforGeeks<br>
<html> <main>
A-118, Sector 136, Noida, <br>
<!-- HTML section tag is used here -->
Uttar Pradesh (201305)
<section>
<body>
</address>
<h1>Geeksforgeek: Section 1</h1>
<h3>HTML Header Tag</h3>
<p>Content of section </p>
<!-- address tag ends here -->
<hr>
</section> </article>
<article>
<!-- HTML section tag ends here --> <br>
<!-- header tag starts --> <!-- aside tag starts here --> <a href="https://www.geeksforgeeks.org/about/">
<header> <aside>
About Us
<h3>GeeksforGeeks Learning</h3> <h1>This is heading text in aside Tag</h1>
</a>|
<p>This is paragraph text in aside Tag</p>
<h3> HTML nav Tag</h3> <a href="https://www.geeksforgeeks.org/privacy-policy/">
</aside>
<!-- nav tag starts --> Privacy Policy
<!-- aside tag ends here -->
<nav> </a>|
</main>
<a href="#">Home</a> | <!-- main tag ends here --> <a href="https://www.geeksforgeeks.org/careers/">
<a href="#">Interview</a> | <!--HTML footer tag starts here--> Careers
<a href="#">Languages</a> | <footer> </a>
<a href="#">Data Structure</a> | <article>
<p>@geeksforgeeks, Some rights reserved</p>
<!-- address tag starts from here -->
<a href="#">Algorithm</a> </footer>
<address>
</nav> <!-- footer tag ends here -->
Organization Name: GeeksforGeeks <br>
<!-- nav tag ends --> </body>
Web Site:
</header> <a href="https://www.geeksforgeeks.org/about/contact-us/">
<!-- header tag ends --> GeeksforGeeks</a><br> </html>
Main root
Text Formatting and Inline Text Semantics
Text formatting tags in HTML, are used to format text in different ways, like making text bold, italicized,
or monospaced. The HTML inline text semantics is used to define the meaning, structure, or style of a
word, line, or any arbitrary piece of text.
Tags Description Syntax
<em> Used to put stress on some text or show some degree of emphasis. <em>…</em>
<head>
<title> Geeks for Geeks </title>
</head>
<body>
<!-- emphasis -->
<div><em>Emphasized text</em></div>
<!-- strong -->
<div><strong>Important text!</strong></div>
<!-- subscript -->
<div>GFG<sub>subscript text</sub></div>
<!-- superscript -->
<div>GFG<sup>Superscript text</sup></div>
<!-- abbreviation -->
<div><abbr>Abbreviation</abbr></div>
<!-- mark -->
<div><mark>Highlighted text</mark></div>
<!-- cite -->
<div><cite>Title of creative work</cite></div>
<!-- time -->
<div>Time<time>9:00 am</time>
to <time>7:00 pm</time>
</div>
</body>
</html>
Main root
Lists
List tags in HTML, including <ul>, <ol>, and <li>, are used to create different types of lists. It can be
either numerical, alphabetic, bullet, or other symbols. There are three list types in HTML:
Unordered list: Used to group a set of related items in no particular order.
Ordered list: Used to group a set of related items in a specific order.
Description list: Used to display name/value pairs such as terms and definitions.
<thead> Used to provide a header to the group of content in an HTML table <thead>…</thead>
<tfoot> Defines a set of rows summarizing the columns of the table. <tfoot>…</tfoot>
Main root
HTML </tr>
<!DOCTYPE html> <tr>
<html> <td>Java programming</td>
<td>Backend development</td>
</tr>
<head>
<tr>
<title>HTML Table</title>
<td>Angular </td>
</head>
<td>Frontend Development</td>
</tr>
<body>
<!-- Table Footer starts here -->
<!-- table starts here --> <tfoot>
<table> <tr>
<!-- Table Caption --> <td>Footer content</td>
<caption>Geeks For Geeks Learning</caption> </tr>
<!-- Table row starts --> </tfoot>
<tr> <!-- Table footer ends here -->
<!--Headers --> </table>
<th>Programming Languages</th> </body>
<th>Development</th>
</tr> </html>
<!-- Table row ends -->
<tr>
<!-- Table data -->
<td>C programming </td>
<td>Full stack development</td>
Main root
Forms
An HTML form is a section of a document that acts as a container for different types of input elements,
such as text fields, passwords, menus, checkboxes, radio buttons, submit buttons, etc.
Generally, Form tags in HTML, like <form>, <input>, <textarea>, and <button>, are used to create forms
for user input.
Tags Description Syntax
Creates a grouping of
<optgroup> options within a <select> <optgroup>.</optgroup>
Represents a section
element.
<form> containing controls for <form>…</form>
submitting information.
Displays an indicator
<progress> showing the degree of <progress>…</progress>
Creates interactive controls completion of a task.
<input> <input>…</input>
for forms to accept data.
<video> Embeds a media player which supports video files in the document. <video>…</video>
<head>
<title>HTML Characters and Symbols</title>
</head>
<body>
<!-- Characters and Symbols are use inside of p element -->
<p>This is the sign of copyright: © </p>
<p>This is the sign of trademark: ™ </p>
<p>This is the sign of ampersand: @ </p>
<p>This is the sign of dollar : $ </p>
<p>This is the sign of less than : < </p>
<p>This is the sign of greater than : > </p>
<p>This is the sign of quotation mark : " </p>
</body>
</html>
Main root
Attributes
Attributes in HTML are used to provide additional information about HTML elements. They are always
specified in the start tag and usually come in name/value pairs like name=”value”. The name is the
property you want to set and the value is the desired value of the attribute.
Attributes Description Syntax Helps to change the
< tag_name style =”…”
Used in the image tag style look and feel of the
>
to specify the document.
alt < tag_name alt =”…” >
alternative text of the
Unique identifier used to
image
id specify an area of a < tag_name id =”…” >
webpage.
Used to define a < tag_name href =”…”
href
hyperlink. > Specifies one or more
< tag_name class =”…”
class class names for an
>
Specifies URL of the element.
src < tag_name src =”…” >
image to be used. Specifies extra
title information about an < tag_name title =”…” >
Specifies the width of < tag_name width =”…” element.
width
the image in pixels. > Specifies a short hint
that describes the <tag_name
Placeholder
Specifies the height of < tag_name height expected value of an placeholder=” “>
height
the image in pixels. =”…” > input field/text area
Main root
HTML <br> Styling using id attribute here
<!DOCTYPE html>
<!-- Link: href attribute--> </h2>
<html>
<a href="https://ide.geeksforgeeks.org/">
<head> Click to open in the same tab <!-- class attribute -->
<title>HTML Attributes</title>
</a> <h2 class="gfg">
<style>
#geeks { <br> Styling using class attribute here
background-color: green; <a href="https://ide.geeksforgeeks.org/" target="_blank"> </h2>
color: white;
Click to open in a different tab
}
</a> <!-- style -->
.gfg { <h2 style="font-family:Chaparral Pro Light; ">
background-color: white;
<!-- title attribute--> Styling using style attribute here
font-size: 30px;
color: red; <h2 title="GeeksforGeeks: A computer science </h2>
} portal for geeks">
</style>
</head>
Title attribute: hover to see the effect </body>
</h2>
<body>
<!-- source attribute-->
</html>
<div>
<!-- Width and Height attribute-->
<p>source attribute:</p> <p>Using width and height attribute here:</p>
<img src= <img src=
"https://media.geeksforgeeks.org/wp-content/cdn-uploads/Geek_logi_-low_res.png">
</div>
"https://media.geeksforgeeks.org/wp-content/cdn-uploads/Geek_logi_-low_res.png"
<!--Alternative text: alt attribute --> width="300px" height="100px">
<div><img src=
"https://media.geeksforgeeks.org/wp-content/cdn-uploads../Geek_logi_-low_res.png"
alt="Alternative text here">
<!-- id attribute-->
</div> <h2 id="geeks">
3 Benefits of Using HTML Cheat Sheet
An HTML Cheat Sheet is a handy tool that makes creating websites faster and easier, helps your
site show up in search results, and lets you build web pages that everyone can use and enjoy.
Semantic Understanding:
With the inclusion of semantic tags in the cheat sheet, developers can create more
meaningful and accessible web content. It aids in understanding the structure and content of
web pages better.
3 Benefits of Using HTML Cheat Sheet
An HTML Cheat Sheet is a handy tool that makes creating websites faster and easier, helps
your site show up in search results, and lets you build web pages that everyone can use and
enjoy.