HTML Notes
HTML
HTML Tags and Elements
Attributes and Hyperlinks
Headings and Lists
Class and id attributes
Semantic Elements
Inline and Block-Level Elements
Div and Span
img
Tables
Forms
Heading
Q
1
What is a Heading in HTML?
Ans
A HTML heading or HTML h tag is a title or a subtitle which gets displayed on the webpage. When the text is placed within the heading tags <h1>.........</h1>, it gets displayed on the browser in the bold and size of the text depends on the number of heading.
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).
h1 is the heading tag with largest font and h6 is the tag with smallest font size . So for most important heading h1 is used and for least important h6 is used .
Heading elements are used for headings only. It can't be used just to make text bold or big.
HTML headings are also used with nested elements.
Q
2
Why are headings important in a webpage?
Ans
1. By highlighting important topics and the structure of the document HTML headings provide valuable information, so to improve user engagement they should be optimized carefully.
2.The headings are used by search engines to index the structure and content of web pages.
3.Users often skim a page by its headings.To show the document structure it is important to use headings.
4.However, headings help readers in identifying the main points of each section in the paper.
Q
3
What are the types of Headings in HTML?
Ans
There six levels of heading tags in HTML , <h1> through <h6>; the higher the heading level number, the greater its importance — therefore <h1> tag is used for the most important heading, whereas the <h6> tag is used for the least important heading in the document.
By default, headings get displayed in larger and bolder font than normal text by browser.<h1> headings displays text in largest font size whereas <h6> headings displays text in smallest font size.
Example :
<h1>level 1</h1>
<h2>level 2</h2>
<h3> level 3</h3>
<h4>level 4</h4>
<h5>level 5</h5>
<h6>level 6</h6>
Q
4
What is a List In HTML?
Ans
To group together related pieces of information lists are used. Lists in HTML are associated with each other and easy to read.
Lists in HTML help in creating a well-structured, more accessible, easy-to-maintain document.
They are also useful because they provide specialized elements to which users can attach CSS styles.
Finally, semantically correct lists help visitors read websites, and they simplify maintenance when pages need to be updated.
Q
5
Differentiate between Ordered and Unordered lists.
Ans
Q
6
What are list item markers?
Ans
list-style-type specify which marker is the list using. For example, it can have the following values: circle, square, upper-roman, lower-alpha.
list-style-image: the only difference is in its input as image url.
list-style-position: It specifies position as outside or inside.
Q
7
What is inserted to remove default settings of list item markers?
Ans
list-style-type:none