HTML or HyperText Markup Language is the standard markup language for documents that are intended to be viewed on a web browser. It is a browser-interpretable language that informs the web browser what to display and how to display it. HTML alone is insufficient for a web developer because it simply outlines the structure of the data that will be presented on the browser in a webpage. Cascading Style Sheet (CSS) and JavaScript help in making the data look appealing and functional on a browser. Do you think you know all about HTML? Attempt these questions to find out.
Q1. The code for inserting an image in an HTML page is:
a. <imgerc=" " alt=" ">
b. <imagerc=" " alt=" ">
c. <imgsrc=" " alt=" ">
d. <img=" " alt=" ">
Q2. What are tags and attributes in HTML?
Q3. What are void elements in HTML?
Q4. What is the advantage of collapsing white space in HTML?
Q5. Is there a difference between HTML tags and elements?
Q6. What is the ‘class’ attribute in HTML?
ANSWERS
Q1. (c)
The code for inserting an image in an HTML page is <imgsrc=" " alt=" ">.
Q2.
Tags are the most important part of HTML since they dictate how the material will be structured and presented, whereas attributes are used in conjunction with HTML tags to describe the element's qualities. For example, <p align=” center”>Interview questions</p>, in this the ‘align’ is the attribute using which we will align the paragraph to show in the center of the view.
Q3.
To specify the start and the end of the element, most HTML elements are surrounded by start and end tags. These elements are known as void elements since they just have start tags and do not contain any content. There are no ending tags for void elements, and they can only have attributes but no content. These elements can have a backslash before the start tag's end, although it's entirely optional. In other words, void elements are HTML elements that don't have closing tags or don't need to be closed. For instance, <br />, img />, hr />, and so on.
Q4.
Since the browser collapses several spaces into a single space character, a blank sequence of whitespace characters in HTML is interpreted as a single space character. It allows a web developer to indent lines of text without worrying about multiple spaces while maintaining the readability of the HTML codes.
Q5.
Tags are the starting and ending parts of an HTML element. They begin with < symbol and end with > symbol. Whatever written inside < and > are called tags. Elements enclose the contents in between the tags. They have some type of structure or expression to them. It usually consists of three tags: start, content, and end.
Q6.
The class attribute is used to define an HTML element's class name. The class value of an HTML element can be the same for many elements. It is also mostly used to connect the styles defined in the stylesheet to HTML elements. Any HTML element can use the class attribute. CSS and JavaScript can use the class name to conduct specific tasks for items with the specified class name.