HTML Interview Questions Part 5

25. What is the use of iframes?

Answer:

You can embed another document within the current HTML document using <iframe> tag. It provides a nested browsing context without using another document by just passing the content to the <iframe> via the srcdoc attribute.

This tag defines a rectangular region within the document in which the browser can display a separate document.

Example:

<!DOCTYPE html>
<html>
    <body>
        <iframe src="http://tutorialride.com/">
        </iframe>
    </body>
</html>


iframe tag

26. What is the difference between 'div' and 'frame' tags?

Answer:

A div tag is a generic container element for grouping and styling, whereas a frame tag creates divisions within a web page and should be used within the frameset tag.

The use of frame and frameset are no longer popular and are now being replaced with more flexible iframe, which has become popular for embedding foreign elements (i.e youtube videos) into a page.

27. What is SPAN in HTML?

Answer:

SPAN is a tag like DIV tag used to group inline-elements in a document.

SPAN tag does not cause a line break. It delimits text and it allows styles to be applied to an 'elemental' region without causing a break in the text flow.

Example:

<!DOCTYPE html>
<html>
    <body>
        <p>Tutorial<span style="color:blue;font-weight:bold">Ride</span>
    </body>
</html>


span tag

28. How to change the number type in the middle of a list?

Answer:

The <li> tag is used to change the number type in the middle of a list.

This tag includes two attributes:

1. type
2. value.

The 'type' attribute is used to change the numbering type for any list item.

The 'value' attribute can change the number index.

29. What is the use of Style Sheets?

Answer:

Style sheets are used to build consistent, transportable, and well-defined style templates.

These templates can be linked to several different web pages, making it easy to maintain and change the look and feel of all the web pages within a site.

You can specify a number of style sheets for a given HTML elements.

Style sheet formats the HTML document according to the information in the style sheet.

30. What do you know about <textarea> tag?

Answer:

The <textarea> tag is used to define a multi-line text input control.

It holds an unlimited number of characters, and the text renders in a fixed-width font.

The size of a text area can be specified by the cols and rows attributes.

Example:

<!DOCTYPE html>
<html>
    <body>
        <textarea rows="4" cols="40">
            TutorialRide is planned to be the home to one of the most exhaustive sections on IT Programming covering almost all the programs that the students have to perform in their practicals, write in university exams or placement tests.
        </textarea>
    </body>
</html>


textarea tag