You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: html.html
+24-23Lines changed: 24 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@
51
51
<divclass="container">
52
52
<h1>html</h1>
53
53
<h2>HTML related interview questions</h2>
54
+
<p>For Javascript developer to have some idea about html to impress interviewer..</p>
54
55
<p>January 01, 2014</p>
55
56
<divclass="g-plusone"></div>
56
57
</div>
@@ -64,27 +65,27 @@ <h2>HTML related interview questions</h2>
64
65
65
66
<!-- <h3>If you have hard time to follow this video, you can see the content below. Things you will learn-</h3> -->
66
67
<ol>
67
-
<li><ahref="#doctype">what is the use of html doctype?</a></li>
68
+
<li><ahref="#doctype">Why do u need doctype?</a></li>
68
69
<li><ahref="#data_attribute">What is the use of data-* attribute?</a></li>
69
70
<li><ahref="#keygen">How can you generate public key in html?</a></li>
70
71
<li><ahref="#bdo">How do you change direction of html text?</a></li>
71
72
<li><ahref="#mark">How can you highlight text in html?</a></li>
72
-
<li><ahref="#scopped">can you apply css to a part of html document only?</a></li>
73
-
<li><ahref="#http_request">Will browser make http request for the following case?</a></li>
73
+
<li><ahref="#scopped">Can you apply css to a part of html document only?</a></li>
74
+
<li><ahref="#http_request">Will browser make http request for the following cases?</a></li>
74
75
<li><ahref="#download_order">Which resource would be downloaded first?</a></li>
75
76
<li><ahref="#optional_tag">What is optional tag?</a></li>
76
77
<li><ahref="#div_span">What are the differences between div and span?</a></li>
77
-
<li><ahref="#div_section_article">How you would differentiate div, section and article?</a></li>
78
+
<li><ahref="#div_section_article">How would you differentiate div, section and article?</a></li>
78
79
<li><ahref="#svg_canvas">How to select svg or canvas for your site?</a></li>
79
-
<li><ahref="#mtuli_lang">How to serve html in multiple language?</a></li>
80
+
<li><ahref="#mtuli_lang">How to serve html in multiple languages?</a></li>
80
81
<li><ahref="#standard_quirks">Explain standard and quirks mode.</a></li>
81
-
<li><ahref="#semantic_html">Array methods in string?</a></li>
82
+
<li><ahref="#semantic_html">What is semantic tag?</a></li>
82
83
</ol>
83
84
<divid="doctype">
84
85
<h2>1. doctype</h2>
85
-
<p><strong>Question:</strong> What is doctype? why do u need it?</p>
86
-
<p><strong>Answer:</strong> doctype is a instruction to the browser to inform about the version of html and how browser should render it.</p>
87
-
<p>It ensures how element should be displayed on the page by most of the browser. And it also makes browsers life easier. otherwise, browser will guess and will go to <ahref="http://en.wikipedia.org/wiki/Quirks_mode">quirks mode</a>. Moreover, doctype is required to <ahref="http://validator.w3.org/">validate markup</a>.</p>
86
+
<p><strong>Question:</strong> What is doctype? Why do u need it?</p>
87
+
<p><strong>Answer:</strong> doctype is an instruction to the browser to inform about the version of html document and how browser should render it.</p>
88
+
<p>It ensures how element should be displayed on the page by most of the browser. And it also makes browser's life easier. otherwise, browser will guess and will go to <ahref="http://en.wikipedia.org/wiki/Quirks_mode">quirks mode</a>. Moreover, doctype is required to <ahref="http://validator.w3.org/">validate markup</a>.</p>
88
89
<pre><code>
89
90
<!DOCTYPE html>
90
91
<meta charset="UTF-8">
@@ -94,8 +95,8 @@ <h2>1. doctype</h2>
94
95
</div>
95
96
<divid="data_attribute">
96
97
<h2>2. data-*</h2>
97
-
<p><strong>Question:</strong>what is the use of data- attribute?</p>
98
-
<p><strong>Answer:</strong> allow you to store extra information/data in the DOM. u can write valid html withe embeded private data. You can easily access data attribute by using javascript and hence a lot of libraries like knockout uses it.</p>
98
+
<p><strong>Question:</strong>What is the use of data- attribute?</p>
99
+
<p><strong>Answer:</strong> allow you to store extra information/data in the DOM. u can write valid html with embeded private data. You can easily access data attribute by using javascript and hence a lot of libraries like knockout uses it.</p>
<p><strong>Question:</strong> What are optional closing tag? and why would u use it?</p>
172
-
<p><strong>Answer:</strong> p, li, td, tr, th, html, body, etc. you dont have to provide end tag. whenever browser hits a new tag it automatically ends the previous tag. However, you have to be careful to escape it.</p>
173
+
<p><strong>Answer:</strong> p, li, td, tr, th, html, body, etc. you dont have to provide end tag. Whenever browser hits a new tag it automatically ends the previous tag. However, you have to be careful to escape it.</p>
173
174
<p><strong>reason:</strong> you can save some byte and reduce bytes needs to be downloaded in a html file.</p>
174
175
<pre><code>
175
176
<p>Some text<br/><p>Some more text<br/><ul><br/> <li>A list item<br/> <li>Another list item<br/></ul>
<p><strong>Question:</strong> What is the difference between span, div?</p>
187
+
<p><strong>Question:</strong> What is the difference between span and div?</p>
187
188
<p><strong>Answer:</strong> div is a block element and span is inline element.</p>
188
-
<p><strong>Extra:</strong>it is illegal to put block element inside inline element. div can have a p tag and a p tag can have a span. However, span can't have a div or p tag inside.</p>
189
+
<p><strong>Extra:</strong>It is illegal to put block element inside inline element. div can have a p tag and a p tag can have a span. However, span can't have a div or p tag inside.</p>
189
190
<p>ref: <ahref="http://stackoverflow.com/questions/183532/what-is-the-difference-between-html-tags-div-and-span">Stackoverflow: div vs span</a></p>
190
191
</div>
191
192
<divid="div_section_article">
192
193
<h2>11. div, section & article</h2>
193
-
<p><strong>Question:</strong> When should i prefer div over section and vice versa?</p>
194
-
<p><strong>Answer:</strong><br><section> means that the content inside is grouped (i.e. relates to a single theme), and should appear as an entry in an outline of the page. A section normally has a heading (title) and maybe a footer too. It’s a chunk of related content, like a subsection of a long article, a major part of the page (eg the news section on the homepage), or a page in a webapp’s tabbed interface.</p>
195
-
<p><div>, on the other hand, does not convey any meaning, aside from any found in its class, lang and title attributes.</p>
194
+
<p><strong>Question:</strong> When should you use section, div or article?</p>
195
+
<p><strong>Answer:</strong><br><section>, group of content inside is related to a single theme, and should appear as an entry in an outline of the page. It’s a chunk of related content, like a subsection of a long article, a major part of the page (eg the news section on the homepage), or a page in a webapp’s tabbed interface. A section normally has a heading (title) and maybe a footer too.</p>
196
196
<p><article>, represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.</p>
197
+
<p><div>, on the other hand, does not convey any meaning, aside from any found in its class, lang and title attributes.</p>
<p><strong>Extra:</strong> Authors are strongly encouraged to view the div element as an element of last resort, for when no other element is suitable. Use of more appropriate elements instead of the div element leads to better accessibility for readers and easier maintainability for authors.</p>
0 commit comments