Q) What is HTML?
A) HTML stands for Hyper Text Markup Language. It is a standard text formatting language for creating web pages. It consists of a series of elements which tell the browser how to display the content
Q) Explain basic HTML document syntax
A) In general a basic HTML document consists of Header and Body tags inside html tags. Its not case sensitive. Below is the simple syntax of HTML document.
<!DOCTYPE html> <html> <head> <title>Sample Title</title> </head> <body> <h1> Sample Heading</h1> <h3> Sample Sub Heading</h3> <p> Sample paragraph which has description or any other content </p> </body> </html>
Q) What are tags and do all html tags have an end tag?(This is one of interviewers favorite question)
A) Html tags are usually composed of an opening tag, content and closing tag. And few html tags don’t have end tag.
Below is the example of html tags with and without end tag
<!--With end tag--> <P></P> <head></head> <!--Without end tag--> </br> <image>
Q) What is an anchor tag or hyperlink in HTML?
A) The HTML provides an anchor tag which is used to create a hyperlink that links one to another page. Below is the syntax for hyper link
<a href="www.Inkfort.com"> This is a link inside anchor tag</a>
Q) Give a sample syntax to bind an image.
A) An image can be shown in a browser with img tag. The following is the example:
<img src="InkFortLogo.jpg" width="200" height="200">
Q) Explain list elements in HTML
A) There are basically 3 common lists:
- Ordered list:The ordered list displays elements in numbered format.
- Unordered list :The unordered list displays elements in bulleted format
- Definition list: The definition list displays elements in definition format like in dictionary.
Q) What are HTML headings?
A) HTML headings are defined as below
HTML headings are defined with <h1>,<h2>.. to <h6> tags <h1> indicates the main and important heading with <h6> being least important or last sub heading before content. The syntax is simple as follows: <h1> This is main heading<h1> <h2> This is also main heading but less than h1<h2> <h6> This is sub heading with least size<h6>
Q) Explain Style Attribute
A) Html elements can be set with many styles using style attribute
Below is the syntax for applying style for any element
<tagname style="property:value;"> Example: <h1 style="color:green;"> This is green heading</h1> <p style="text-align:center;"> The text is aligned to show in center</p>
Q) What is HTML Formatting?
A) HTML uses element tags to provide various formatting to text. The result gives special type of text. Below are few examples for same:
<b> - for making text Bold <i> - for making text italic <strong> - for showing text as important <sub> - for subscript text <sup> - for superscript text
Q) What is CSS? Explain briefly(Every interviewer will ask basic questions on CSS if he is expecting you to work on UI)
A) CSS stands for Cascading style sheets. It is mainly to used to control themes, and to change layout of multiple web pages at once.
CSS can be used at 3 levels:
Inline: by using the style attributes at HTML element level
Internal: by using style attribute in part of HTML document
External: by using style attribute in external CSS file
Q) Explain table tag in HTML
A) To render a table in HTML with multiple rows and columns we can use
tag. It can be used with and
tags to generate row, data and header respectively. Below is simple table using tags.
<table> <tr> <th> EmpId </th> <th> EmpName </th> <th> EmpSalary </th> </tr> <tr> <td> 101 </td> <td> MAK </td> <td> 5000 </td> </tr> <tr> <td> 102 </td> <td> Fort </td> <td> 6000 </td> </tr> </table>
Q) What is <form> element?
A) The HTML form element defines a form which is used to collect user input details. It contains different input elements like text box, combo box, radio buttons, check boxes and other controls.
Below are few syntaxes: <input type="text" > <input type="radio">
Q) What is select element?
A) select element is used to define a drop down list for input selection. Below is sample
<select name="Birds"> <option value="Peacock">Peacock</option> <option value="Eagle">Eagle</option> <option value="Parrot">Parrot</option>
Q) What is nested web page in HTML and how to create it?
A) A web page inside another web page is called nested web page. The HTML iframe tag is used to display nested web page.
Below is the example of iframe:
<html> <body> <h2> Iframes example </h2> <iframe src="https://www.inkfort.com/" height="300" width="300"></iframe> </body> </html>
Q) What is the use of a span tag?
A) The span tag is used for adding color on text, adding background and Highlight any color