HTML 5 FAQS for interview
Ques 1 : What is HTML 5?
Ans : HTML 5 is a new standard for HTML whose main target is to deliver everything without need to any additional plugins like flash, Silverlight etc. It has everything from animations, videos, rich GUI etc.
HTML5 is cooperation output between World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG).
Ques 2 : Can HTML 5 work without <! DOCTYPE html> Tag?
Ans : No, browser will not be able to identify that it’s a HTML document and HTML 5 tags will not function properly.
Ques 3 : What is the relationship between SGML,HTML , XML and XHTML?
Ans : SGML (Standard generalized markup language) is a standard which tells how to specify document markup. It’s only a Meta language which describes how a document markup should be. HTML is a markup language which is described using SGML.
So by SGML they created DTD which the HTML refers and needs to adhere to the same. So you will always find “DOCTYPE” attribute at the top of HTML page which defines which DTD is used for parsing purpose.
Now parsing SGML was a pain so they created XML to make things better. XML uses SGML. For example in SGML you have to start and end tags but in XML you can have closing tags which close automatically (“”).
XHTML was created from XML which was used in HTML 4.0. So for example in SGML derived HTML “
” is not valid but in XHTML it’s valid. You can refer XML DTD as shown in the below code snippet.
Ques 4 : What is the difference between <b> and <strong> Tags ?
Ans : The HTML <b> element defines bold text, without any extra importance. While the HTML <strong> element defines strong text, with added semantic “strong” importance.<b> element defines bold text, without any extra importance. While the HTML <strong> element defines strong text, with added semantic “strong” importance.
Ques 5 : What is difference between <i> and <em> Tags ?
Ans : The HTML <i> element defines italic text, without any extra importance. While the HTML <em> element defines emphasized text, with added semantic importance.
Ques 6: Why we use <cite> and <bdo>Tags ?
Ans : <cite> The HTML cite element defines the title of a work. Browsers usually display cite elements in italic.
<bdo dir="rtl">This text will be written from right to left</bdo>
This line will be written from right to left