Professional Documents
Culture Documents
HTML & Css Iq&a Sep2022
HTML & Css Iq&a Sep2022
1) What is HTML?
HTML stands for Hyper Text Markup Language. It is a language of World Wide Web. It is a standard text
formatting language which is used to create and display pages on the Web. It makes the text more
interactive and dynamic. It can turn text into images, tables, links.
7) Which HTML tag is used to display the data in the tabular form?
The HTML table tag is used to display data in tabular form (row * column). It also manages the layout of
the page, e.g., header section, navigation bar, body content, footer section. Here is the list of tags used
while displaying the data in the tabular form:
Tag Description
<col> It is used with <colgroup> element to specify column properties for each column.
What is a Z Index?
Z Index (z-index) is a CSS property that defines the order of overlapping
HTML elements. Elements with a higher index will be placed on top of
elements with a lower index.
Note: Z index only works on positioned elements
(position:absolute, position:relative, or position:fixed).
Pseudo-classes#
Pseudo-classes select regular elements but under certain conditions, like when their
position relative to siblings or when they’re under a particular state. Here is a list of
pseudo-classes in CSS3:
Pseudo-elements
Pseudo-elements effectively create new elements that are not specified in the
markup of the document and can be manipulated much like a regular element. This
introduces huge benefits for creating cool effects with minimal markup, also aiding
significantly in keeping the presentation of the document out of the HTML and in
CSS where it belongs.
With the introduction of CSS3 the difference between pseudo-classes and pseudo-
elements is a lot more clear as it is now the standard to use double colon (::) on
pseudo-elements, however we should be using single colon until certain browsers
are phased out (I’m looking at you IE8 and below). Here is a list of pseudo-elements
in CSS3:
A semantic element clearly describes its meaning to both the browser and the developer.
Examples of non-semantic elements: <div> and <span> - Tells nothing about its content.
Examples of semantic elements: <form>, <table>, and <article> - Clearly defines its content
CSS
1) What is CSS?
CSS stands for Cascading Style Sheet. It is a popular styling language which is used with HTML to design
websites. It can also be used with any XML documents including plain XML, SVG, and XUL
o Bandwidth
o Site-wide consistency
o Page reformatting
o Accessibility
o Content separated from presentation
28) What is the CSS Box model and what are its elements?
The CSS box model is used to define the design and layout of elements of CSS.
To understand its purpose and origin, let's take a look at its print display. In the print display, an image is
set into the page such that text wraps around it as needed.
An element with a higher z-index is always stacked above than a lower index.
Padding property
The CSS padding properties define the space between the element border and the element content.
Border property
The CSS border properties allow you to specify the style and color of an element’s border.
Margin property
The CSS margin properties define the space around elements. The margin clears an area around an
element (outside the border). The margin does not have a background color, and is completely
transparent.
position: static;
HTML elements are positioned static by default.
Static positioned elements are not affected by the top, bottom, left, and right properties.
An element with position: static; is not positioned in any special way; it is always positioned
according to the normal flow of the page:
position: relative;
An element with position: relative; is positioned relative to its normal position.
Setting the top, right, bottom, and left properties of a relatively-positioned element will cause it
to be adjusted away from its normal position. Other content will not be adjusted to fit into any
gap left by the element.
position: fixed;
An element with position: fixed; is positioned relative to the viewport, which means it always
stays in the same place even if the page is scrolled. The top, right, bottom, and left properties
are used to position the element.
A fixed element does not leave a gap in the page where it would normally have been located.
position: absolute;
An element with position: absolute; is positioned relative to the nearest positioned ancestor
(instead of positioned relative to the viewport, like fixed).
However; if an absolute positioned element has no positioned ancestors, it uses the document
body, and moves along with page scrolling.
position: sticky;
An element with position: sticky; is positioned based on the user's scroll position.
A sticky element toggles between relative and fixed, depending on the scroll position. It is
positioned relative until a given offset position is met in the viewport - then it "sticks" in place
(like position:fixed).