Monday, October 19, 2015

HTML/HTML5 Interview Questions and Answers

1) What is HTML?
HTML (HyperText Markup Language) is a markup language for web pages. So HTML will have HTML elements, which is enclosed in angular brackets.
2) What are tags in HTML?
Tags are content in HTML to format the HTML properly. It uses symbols like “<” and “>” to enclose the tags. “/” symbol is used for closing the tag.
3) What is XHTML?
XHTML will follow XML rules. So it means it is a case sensitive. HTML pages can be changed to XHTML. So during this process we have to find the images, line breaks etc. to include the closing tags. XHTML is compatible with XML.
4) What is DHTML?
DHTML is a combination of HTML and client side scripting languages like – javascript, css etc. Good example for this would be navigation menu in web page.
5) How we can insert comment in HTML?
Below is the example for writing the comment in HTML –
<!-- MY SAMPLE COMMENT -->
6) What is DOCTYPE?
Every HTML elements should begin with this declaration of DOCTYPE. This is used to specify the version of HTML used in the given document.
<!DOCTYPE html>
7) Which editors I can use for HTML development?
Below are the list of editors which I can use for HTML development –
  • Dreamweaver.
  • CoffeeCup HTML Editor.
  • Microsoft Expression Web.
  • NotePad ++.
  • TextEdit etc.
8) Explain HTML Headings?
In HTML, title or subtitle can be given from heading tags. So the size of the text depends on heading tag. Eg:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
9) How to align <table> right/left in HTML?
If you are using <table> tag, then “align” attribute can be used to align the table to right/left. Below is the sample to align the table to right/left.
<table align="right">
<table align="left">
10) How we can display <table> at the center of the webpage?
Below is the example to show it -
<div style="margin-left: auto; margin-right: auto;">
<table>...</table>
</div>

No comments: