Basic of HTML Heading (1)
Basic of HTML Heading (1)
There are six different HTML headings which are defined with the
<h1> to <h6> tags, from highest level h1 (main heading) to the
least level h6 (least important heading).
Heading no. 6
Heading elements (h1....h6) should be used for headings only. They should not
be used just to make text bold or big.
2
Example:
<!DOCTYPE html>
<html>
<head>
<title>Heading elements</title>
</head>
<body>
<p>We can use h1 to h6 tag to use the different sub-heading with their
paragraphs if
required.
</p>
</body>
</html>
Output:
3
Attributes
There are no specific attributes applied to the h1 tag in html, Only global
attributes are applied to the h1 tag in html.
Note: In HTML5 the align attribute is not supported, for this, we have to use
CSS instead of align attribute.
HTML Paragraph
HTML paragraph or HTML p tag is used to define a paragraph in a
webpage. Let's take a simple example to see how it work. It is a
notable point that a browser itself add an empty line before and
after a paragraph. An HTML <p> tag indicates starting of new
paragraph.
Note: If we are using various <p> tags in one HTML file then browser
automatically adds a single blank line between the two paragraphs.
example:
Output:
Output:
Look, I put here a lot of spaces but I know, Browser will ignore it.
As you can see, all the extra lines and unnecessary spaces are
removed by the browser.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2> Use of line break with pragraph tag</h2>
<p><br>Papa and mama, and baby and Dot,
<br>Willie and me?the whole of the lot
<br>Of us all went over in Bimberlie's sleigh,
<br>To grandmama's house on Christmas day.
</p>
HTML Formatting
HTML Formatting is a process of formatting text for better
look and feel. HTML provides us ability to format text without
using CSS. There are many formatting tags in HTML. These tags
are used to make text bold, italicized, or underlined. There are
almost 14 options available that how text appears in HTML and
XHTML.
Element Description
name
1) Bold Text
HTML<b> and <strong> formatting elements
Backward Skip 10sPlay VideoForward Skip 10s
8
Output:
Output:
2) Italic Text
HTML <i> and <em> formatting elements
Output:
The HTML <em> tag is a logical element, which will display the
enclosed content in italic font, with added semantics
importance.
Output:
Output:
4) Underlined Text
If you write anything within <u>.........</u> element, is shown in
underlined text.
Output:
5) Strike Text
Anything written within <strike>.......................</strike> element
is displayed with strikethrough. It is a thin line which cross the
statement.
Output:
6) Monospaced Font
11
If you want that each letter has the same width then you
should write the content within <tt>.............</tt> element.
Output:
7) Superscript Text
If you put the content within <sup>..............</sup> element, is
shown in superscript; means it is displayed half a character's
height above the other characters.
Output:
8) Subscript Text
If you put the content within <sub>..............</sub> element, is
shown in subscript ; means it is displayed half a character's
height below the other characters.
Output:
9) Deleted Text
Anything that puts within <del>..........</del> is displayed as
deleted text.
Output:
Hello
Output:
Output:
Output:
<html>
<body>
<p>
<!-- html q tag is used here -->
<q>GeeksforGeeks</q>
A computer science portal for geeks
</p>
</body>
</html>
Output:
15
This tag can be used with "title" attribute (optional), and the value
of title attribute will be pop-up when the mouse hovers over the
content written between <abbr> tag.
Syntax
1. <abbr title="HyperText Markup language">HTML</abbr>
2. specifications about the HTML <abbr> tag
Display Inline
Usage Semantic/Textual
<body>
<h2>Abbreviation tag example</h2>
<p><b>Hover mouse over the content and see the abbreviation</
b></p>
<abbr title="Hyper Text Transfer protocol">HTTP</abbr>
</body>
HTML <address> tag
HTML <address> tag is used to specify the authorship information of the
article or webpage. It can contain any type of information which is needed
such as, URL, physical address, phone number, email, other links, etc.
The <address> tag is useful for various contexts such as business contact
information in the header of the page, or author related contact
information, etc.
Note: To represent a random address use <p> tag instead of <address> tag, as it should
contain the main contact information.
Syntax
1. <address>Contact Author at:<br>
2. <a href="mailto:[email protected]">[email protected]</a></addres
s>
If you want to specify the information of the author for an article, you must
place the <address> tag inside the <article> element.
Display Block
Usage Semantic
Example
<body>
<h2>Example of Address tag</h2>
<address>The article is written by:<b>Harshita</b> <br>Contact Au
thor at:
<a href="mailto:[email protected]">[email protected]</a><br>Yo
u can also visit our blog:
<a href="http://javatpoint.blogspot.com/">javaTpoint blog</a>
</address>
</body>
Attributes
The <address> tag does not contain any specific attribute for it.
Global Attribute:
The <address> tag supports the global attributes.
Event attribute:
Element Chrome IE Firefox Opera Safari
The <address> tag
supports all Events attributes.
Supporting Browsers
17