HTML Notes11
HTML Notes11
Tags
Editors
22. Comment Tag - HTML comment tags help the developer to insert comments in
between <!-- Text --> tags.
Eg:- <!-- Here writing a comment. The comment will not display in the
web browser. -->
23. Order list - HTML <ol> tag is abbreviated as an Ordered List, which is used for
numbering the lists on a web page. Each list item starts with the <li> tag.
Attributes –
<ol type = "1"> - Numbers, which is the default type of Ordered List.
<ol type = "i"> - Numerals (roman) with lower caps.
<ol type = "I"> - Numerals (roman) with upper caps.
<ol type = "a"> - Numbering will be done in the form of Lower-case
Letters.
<ol type = "A"> - Numbering will be done in the form of upper-case
Letters.
Eg:- <ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
24. Un-order list - HTML UL tag is abbreviated as an Unordered List, used to list your
items via bullets and circles. Each list item starts with the <li> tag.
Attributes –
Eg:- <ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
25. <dl>, <dt>, <dd> Tag - The <dl> tag defines the description list,
the <dt> tag defines the term (name), and the <dd> tag describes each term:
Eg:- <dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
Attributes –
Autofocus - Specifies that the drop-down list should automatically
get focus when the page loads.
Disabled - Specifies that a drop-down list should be disabled.
Form_id - Defines which form the drop-down list belongs to.
Multiple - Specifies that multiple options can be selected at once.
Name - Defines a name for the drop-down list.
Required - Specifies that the user is required to select a value
before submitting the form.
Size - Defines the number of visible options in a drop-down list.
<optgroup> - </optgroup> - The <optgroup> tag is used to
group related options in a <select> element. If you have a long list
of options, groups of related options are easier to handle for a user.
27. Detail tag - The <details> tag specifies additional details that the
user can open and close on demand. The <summary> tag is used in
conjunction with <details> to specify a visible heading for the details.
Eg:- <details>
<summary>Epcot Center</summary>
<p>Epcot is a theme park at Walt Disney World
Resort featuring exciting attractions, international pavilions, award-
winning fireworks and seasonal special events.</p>
</details>
29. Acronym tag - The <acronym> tag was used in HTML 4 to define an
acronym.
Eg:- The <acronym title="World Health
Organization">WHO</acronym> was founded in 1948.
30. Base Tag - The <base> tag specifies the base URL and/or target for all
relative URLs in a document. The <base> tag must have either an href or a
target attribute present, or both. There can only be one single <base> element
in a document, and it must be inside the <head> element.
31. Bdo tag - BDO stands for Bi-Directional Override. The <bdo> tag is
used to override the current text direction.
Attributes –
Dir - Required. Specifies the text direction of the text inside the
<bdo> element.
Value – ltr & rtl.
32. Blockquote tag - The <blockquote> tag specifies a section that is quoted
from another source. Browsers usually indent <blockquote> elements (look
at example below to see how to remove the indentation).
Attributes –
Eg:-
<blockquote cite="http://www.worldwildlife.org/who/index.html">
For 50 years, WWF has been protecting the future of nature. The world's
leading conservation organization, WWF works in 100 countries and is
supported by 1.2 million members in the United States and close to 5
million globally.
</blockquote>
33. Cite tag - The <cite> tag defines the title of a creative work (e.g. a
book, a poem, a song, a movie, a painting, a sculpture, etc.).
Eg:- <ul>
<li><data value="21053">Cherry Tomato</data></li>
<li><data value="21054">Beef Tomato</data></li>
<li><data value="21055">Snack Tomato</data></li>
</ul>
37. Dialog tag - The <dialog> tag defines a dialog box or subwindow.
The <dialog> element makes it easy to create popup dialogs and modals on
a web page.
Attributes –
Open - Specifies that the dialog element is active and that the
user can interact with it.
The <div> tag is used as a container for HTML elements - which is then styled
with CSS or manipulated with JavaScript.
Note: By default, browsers always place a line break before and after
the <div> element.
Eg:-
<head>
<style>
.myDiv {
border: 5px outset red;
background-color: lightblue;
text-align: center;
}
</style>
</head>
<body>
<div class="myDiv">
<h2>This is a heading in a div element</h2>
<p>This is some text in a div element.</p>
</div>
</body>
</html>
Attributes –
Eg:-
<embed type="image/jpg" src="pic_trulli.jpg" width="300" height="200">
40. Figure & figcaption tag - The <figure> tag specifies self-contained
content, like illustrations, diagrams, photos, code listings, etc.
While the content of the <figure> element is related to the main flow, its
position is independent of the main flow, and if removed it should not affect
the flow of the document.
The <figcaption> element can be placed as the first or last child of the
<figure> element.
Eg:- <figure>
<img src="pic_trulli.jpg" alt="Trulli" style="width:100%">
<figcaption>Fig.1 - Trulli, Puglia, Italy.</figcaption>
</figure>
Eg:- <header>
<h1>A heading here</h1>
<p>Posted by John Doe</p>
<p>Some additional information here</p>
</header>
42. Footer tag - The <footer> tag defines a footer for a document or
section.
A <footer> element typically contains:
authorship information
copyright information
contact information
sitemap
back to top links
related documents
Eg:-
<footer>
<p>Author: Hege Refsnes</p>
<p><a href="mailto:hege@example.com">hege@example.com</a></p>
</footer>
43. Main tag - The <main> tag specifies the main content of a document.
The content inside the <main> element should be unique to the document. It
should not contain any content that is repeated across documents such as
sidebars, navigation links, copyright information, site logos, and search
forms.
Note: There must not be more than one <main> element in a document.
The <main> element must NOT be a descendant of an <article>, <aside>,
<footer>, <header>, or <nav> element.
Eg:-
<main>
<h1>Most Popular Browsers</h1>
<p>Chrome, Firefox, and Edge are the most used browsers today.</p>
<article>
<h2>Google Chrome</h2>
<p>Google Chrome is a web browser developed by Google, released in
2008. Chrome is the world's most popular web browser today!</p>
</article>
<article>
<h2>Mozilla Firefox</h2>
<p>Mozilla Firefox is an open-source web browser developed by
Mozilla. Firefox has been the second most popular web browser since
January, 2018.</p>
</article>
<article>
<h2>Microsoft Edge</h2>
<p>Microsoft Edge is a web browser developed by Microsoft, released
in 2015. Microsoft Edge replaced Internet Explorer.</p>
</article>
</main>
44. Meter tag & Progress tag - The <meter> tag defines a scalar
measurement within a known range, or a fractional value. This is also known
as a gauge.
Examples: Disk usage, the relevance of a query result, etc.
Note: The <meter> tag should not be used to indicate progress (as in a
progress bar). For progress bars, use the <progress> tag.
Note: The <progress> tag is not suitable for representing a gauge (e.g. disk
space usage or relevance of a query result). To represent a gauge, use
the <meter> tag instead.
Eg:-
<label for="disk_c">Disk usage C:</label>
<meter id="disk_c" value="2" min="0" max="10">2 out of 10</meter><br>
<label for="disk_d">Disk usage D:</label>
<meter id="disk_d" value="0.6">60%</meter>
45. Navigation tag - The <nav> tag defines a set of navigation links.
Notice that NOT all links of a document should be inside a <nav> element.
The <nav> element is intended only for major blocks of navigation links.
Browsers, such as screen readers for disabled users, can use this element to
determine whether to omit the initial rendering of this content.
Eg:- <nav>
<a href="/html/">HTML</a> |
<a href="/css/">CSS</a> |
<a href="/js/">JavaScript</a> |
<a href="/python/">Python</a>
</nav>
The <noscript> element can be used in both <head> and <body>. When
used inside <head>, the <noscript> element could only contain <link>,
<style>, and <meta> elements.
Eg:- <script>
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!</noscript>
47. Script tag - The <script> tag is used to embed a client-side script
(JavaScript).
Common uses for JavaScript are image manipulation, form validation, and
dynamic changes of content.
Attributes –
Eg:- <script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
48. Object tag - The <object> tag defines a container for an external
resource.
Attributes –
A ruby annotation is a small extra text, attached to the main text to indicate
the pronunciation or meaning of the corresponding characters. This kind of
annotation is often used in Japanese publications.
Use <ruby> together with <rt> and <rb>: The <ruby> element consists of one
or more characters that needs an explanation/pronunciation, and an <rt>
element that gives that information, and an optional <rb> element that
defines what to show for browsers that do not support ruby annotations.
Eg:- <ruby>
<rb>HTML</rb>
<rt>Hyper Text Mark Up Language</rt>
</ruby>
<section>
<h2>WWF's Symbol</h2>
<p>The Panda has become the symbol of WWF. The well-known panda logo of
WWF originated from a panda named Chi Chi that was transferred from the
Beijing Zoo to the London Zoo in the same year of the establishment of
WWF.</p>
</section>