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: areas/html.html
+28-23Lines changed: 28 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -71,21 +71,24 @@ <h2>HTML related interview questions</h2>
71
71
<li><ahref="#scopped">can you apply css to a part of html document only?</a></li>
72
72
<li><ahref="#http_request">Will browser make http request for the following case?</a></li>
73
73
<li><ahref="#download_order">Which resource would be downloaded first?</a></li>
74
-
<li><ahref="#standard_quirks">Explain standard and quirks mode.</a></li>
74
+
<li><ahref="#optional_tag">What is optional tag?</a></li>
75
75
<li><ahref="#div_span">What are the differences between div and span?</a></li>
76
76
<li><ahref="#div_section_article">How you would differentiate div, section and article?</a></li>
77
77
<li><ahref="#svg_canvas">How to select svg or canvas for your site?</a></li>
78
78
<li><ahref="#mtuli_lang">How to serve html in multiple language?</a></li>
79
-
<li><ahref="#optional_tag">What is optional tag?</a></li>
79
+
<li><ahref="#standard_quirks">Explain standard and quirks mode.</a></li>
80
80
<li><ahref="#semantic_html">Array methods in string?</a></li>
81
81
</ol>
82
82
<divid="doctype">
83
83
<h2>1. doctype</h2>
84
84
<p><strong>Question:</strong> What is doctype? why do u need it?</p>
85
85
<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>
86
86
<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>
87
-
<p><strong>extra:</strong> this the first tag of html file, dont need a closing tag and not case senstitive.</p>
88
-
87
+
<pre><code>
88
+
<!DOCTYPE html>
89
+
<meta charset="UTF-8">
90
+
</code></pre>
91
+
<p><strong>extra:</strong> this the first tag of html file, dont need a closing tag and not case senstitive.</p>
89
92
ref: <ahref="http://www.w3.org/QA/Tips/Doctype">don't forget doctype</a>, <ahref="http://www.2ality.com/2012/06/dense-arrays.html">Sparse vs Dense Array</a>
90
93
</div>
91
94
<divid="data_attribute">
@@ -117,6 +120,7 @@ <h2>4. bdo</h2>
117
120
</code></pre>
118
121
<strong>result:</strong>
119
122
<p><bdodir="rtl">This text will go right to left.</bdo></p>
123
+
<p><strong>extra:</strong> rtl: right to left. and alternatively you can use, ltr: left to right</p>
<p><strong>Question:</strong> Difference between standard mode and quirks mode</p>
167
-
<p><strong>Answer:</strong> quriks mode in browser allows u to render page for as old browsers. This is for backward compatibility.</p>
168
+
<divid="optional_tag">
169
+
<h2>9. self closing tag</h2>
170
+
<p><strong>Question:</strong>What are optional closing tag? and why would u use it?</p>
171
+
<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>
172
+
<p><strong>reason:</strong> you can save some byte and reduce bytes needs to be downloaded in a html file.</p>
173
+
<pre><code>
174
+
<p>Some text<br/><p>Some more text<br/><ul><br/> <li>A list item<br/> <li>Another list item<br/></ul>
175
+
</code></pre>
176
+
<p> the above html will be parsed as the following blocks</p>
177
+
<pre><code>
178
+
<p>Some text</p><br/><p>Some more text</p><br/><ul><br/> <li>A list item</li><br/> <li>Another list item</li><br/></ul>
179
+
</code></pre>
180
+
<p>ref: <ahref="http://www.w3.org/TR/REC-html40/index/elements.html">W3.org: index of elements</a></p>
168
181
</div>
182
+
<h1>Old School questions</h1>
169
183
<divid="div_span">
170
184
<h2>10. span vs div</h2>
171
185
<p><strong>Question:</strong> What is the difference between span, div?</p>
<p><strong>Question:</strong>What are optional closing tag? and why would u use it?</p>
200
-
<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>
201
-
<p><strong>reason:</strong> you can save some byte and reduce bytes needs to be downloaded in a html file.</p>
202
-
<pre><code>
203
-
<p>Some text<br/><p>Some more text<br/><ul><br/> <li>A list item<br/> <li>Another list item<br/></ul>
204
-
</code></pre>
205
-
<p> the above html will be parsed as the following blocks</p>
206
-
<pre><code>
207
-
<p>Some text</p><br/><p>Some more text</p><br/><ul><br/> <li>A list item</li><br/> <li>Another list item</li><br/></ul>
208
-
</code></pre>
209
-
<p>ref: <ahref="http://www.w3.org/TR/REC-html40/index/elements.html">W3.org: index of elements</a></p>
211
+
<divid="standard_quirks">
212
+
<h2>14. standar & quirks mode</h2>
213
+
<p><strong>Question:</strong> Difference between standard mode and quirks mode</p>
214
+
<p><strong>Answer:</strong> quriks mode in browser allows u to render page for as old browsers. This is for backward compatibility.</p>
0 commit comments