HTML interview questions and answers part 2

          

HTML interview questions and answers part 2


Part 1   Part 2   Part 3   Part 4   Part 5

10. What are the different way in which website layout can be made?

Website layout describes how the webpage of the website will look. It describes the content that has to be placed in columns i.e. it can be either one or many columns. There are two ways in which different layout can be created and these are called as using table method or using div method. There are basically two tags that are used <table> and <div>.
<table>: using this is the simplest way to create a layout.
The example code is given as:
<html>
<body>
<table width="500" border="0">
<tr>
<td colspan="2" style="background-color:#FFA500;">
<h1>Main Title</h1>
</td>
</tr>
<tr>
<td colspan="2" style="background-color:#FFA500;text-align:center;">
This is my page</td>
</tr>
</table>
</body>
</html>

<div>: it is used as a block element and is defined to group HTML elements together in one. The <div> tag is used to create multiple layouts. The sample code is given as:
<html>
<body>
<div id="container" style="width:500px">
<h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>
<b>Menu</b><br />
</div>
</body>
</html>

11. What is the importance of Doctype in HTML?

Doctype tag is not a HTML tag, it is just an instruction that is passed to the web browser to check for the information that is being provided by the markup language in which the page is written. Doctype is sometimes referred as Document type definition (DTD) that describes some rules that has to be followed while writing the markup language so to make the web browser understand the language and the content correctly. Doctype is very important to be placed in the beginning of the HTML and before the <HTML> tag to allow easy rendering of the pages that are used.

12. Differentiate different types of Doctypes from one another

Doctype helps the web browser to correctly render the web pages. There are different types of Doctype that are available and they are as follows:
Strict Doctype: it consists of all the HTML elements and it is also known as DTD (Document type definition) but it doesn't include the presentational and deprecated elements i.e. font, center, etc. Framesets related elements are also not allowed in this. For example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Transitional Doctype: it consists of all the HTML elements and attributes. It is also known as DTD (Document type definition). It includes the presentational and deprecated elements i.e. font, center, etc. Framesets related elements are also not allowed in this. For example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Frameset Doctype: it consists of all the HTML elements and attributes. It is also known as DTD (Document type definition). It includes the presentational and deprecated elements i.e. font, center, etc. Framesets related elements are also allowed in this. For example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

13. Why it is important to set the meta information?

Metadata is the data about the data or the information about the data. There is a tag <meta> that is being provided for the HTML document. This information won't be displayed anywhere and will not be visible to the user. It will be parsable by the machine which will parse it according to the requirement. It consists of the elements that are related to the page description, keywords, document related element. The tag that is being used resides in the <head> section in HTML. The meta information is being used by the web browser or by the search engines to rank and let the user find the pages easily. The meta information is being written as:
<meta name="description" content="Here you will get everything" />

14. What are the different types of entities in HTML?

The different types of entities that are present in HTML are < (less than) or > (greater then). It allows the special or the reserved characters are matched with the source code and then it is saved. The sample code is being given by:
&entity_name;
OR
&#entity_number;
There is always a concept associated with it that will create more simpler provision to avoid the spaces that are being coming in between the characters or the text.



Write your comment - Share Knowledge and Experience


Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring