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
Define Inline Elements in HTML.
Ans
Inline elements occupy the space as needed within space defined by the main element. An inline element doesn’t start with a new line and it takes only the width required.
Some examples of Inline elements are-
a.<b>, <i>, <u>
b.<a>, <img>
c.<span>
Q
2
Define Block-Level Elements in HTML.
Ans
Block elements occupy the entire space between the tags. A block element always starts with a new line and takes up the full width available.
Some examples of Block elements are-
a. <header>, <h1---h6>
b. <p>
c.<div>
Q
3
How can the inline and block-level elements be changed?
Ans
This conversion is possible through CSS. We can’t convert inline intoblock element or vice versa at all. Basically, what we do is change the display: property of the inline element to block element. This does not make it a block element but makes it display as a block element. Once this conversion is done, attributes like height, width can be applied to the text.