Skip to content

correcting typos: correcting hat's to what's #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;/</span>html</span><span class="token cBase">&gt;</span></span></code></pre></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://github.com/FuelFrontend/Frontend-Developer-Interview-Preparation" rel="noreferrer" target="_blank" title="Explain meta tags in HTML Interview Questions Source To Answer">github.com/FuelFrontend</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 4. What is the purpose of the alt attribute on images?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>The <code>alt</code> attribute provides alternative information for an image if a user cannot view it. The <code>alt</code> attribute should be used to describe any images except those which only serve a decorative purposes, in which case it should be left empty.</p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML" rel="noreferrer" target="_blank" title="What is the purpose of the alt attribute on images? Interview Questions Source To Answer">developer.mozilla.org</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 5. What is the difference between span and div?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><ul><li><code>div</code> is a block element</li><li><code>span</code> is inline element </li></ul><p>For bonus points, you could point out that it’s illegal to place a block element inside an inline element, and that while <code>div</code> can have a <code>p</code> tag, and a <code>p</code> tag can have a <code>span</code>, it is not possible for <code>span</code> to have a <code>div</code> or <code>p</code> tag inside.</p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://thatjsdude.com/INTERVIEW/HTML.HTML" rel="noreferrer" target="_blank" title="What is the difference between span and div? Interview Questions Source To Answer">thatjsdude.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 6. How can you highlight text in HTML?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>If you are working with an HTML5 page, the <code>&lt;mark&gt;</code> tag can be a quick and easy way of highlighting or marking text on a page:</p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>mark</span><span class="token cBase">&gt;</span></span>highlighted text<span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;/</span>mark</span><span class="token cBase">&gt;</span></span></code></pre><p>To highlight text with just HTML code and support for all browsers, set the background-color style, as shown in the example below, using the <span><span></span></span> HTML tag.</p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>span</span><span class="token style-attr language-css"><span class="token cVar"> <span class="token cVar">style</span></span><span class="token cBase">="</span><span class="token cString"><span class="token cVar">background-color</span><span class="token cBase">:</span> #FFFF00</span><span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span>Yellow text.<span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;/</span>span</span><span class="token cBase">&gt;</span></span></code></pre></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://www.computerhope.com/issues/ch001391.htm" rel="noreferrer" target="_blank" title="How can you highlight text in HTML? Interview Questions Source To Answer">computerhope.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 7. What were some of the key goals and motivations for the HTML5 specification?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>HTML5 was designed to replace HTML 4, XHTML, and the HTML DOM Level 2. The key goals and motivations behind the HTML5 specification were to:</p><ul><li>Deliver rich content (graphics, movies, etc.) without the need for additional plugins, such as Flash.</li><li>Provide better semantic support for web page structure through new structural element tags.</li><li>Provide a stricter parsing standard to simplify error handling, ensure more consistent cross-browser behaviour, and simplify compatibility with documents written to older standards.</li><li>Provide better cross-platform support whether running on a PC, Tablet, or Smartphone.</li></ul></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://www.toptal.com/html5/interview-questions" rel="noreferrer" target="_blank" title="What were some of the key goals and motivations for the HTML5 specification? Interview Questions Source To Answer">toptal.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 8. What is Character Encoding?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>To display an HTML page correctly, a web browser must know which character set (character encoding) to use. This is specified in the <meta> tag:</p><p><strong>HTML4:</strong></p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>meta</span> <span class="token cVar">http-equiv</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>Content-Type<span class="token cBase">"</span></span> <span class="token cVar">content</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>text/html;charset=ISO-8859-1<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span></code></pre><p><strong>HTML5:</strong></p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>meta</span> <span class="token cVar">charset</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>UTF-8<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span></code></pre></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://www.w3schools.com/html/html_charset.asp" rel="noreferrer" target="_blank" title="What is Character Encoding? Interview Questions Source To Answer">w3schools.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 9. What is a self closing tag?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>In HTML5 it is not strictly necessary to close certain HTML tags. The tags that aren’t required to have specific closing tags are called “self closing” tags.</p><p>An example of a self closing tag is something like a line break (<code>&lt;br /&gt;</code>) or the meta tag (<code>&lt;meta&gt;</code>). This means that the following are both acceptable:</p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>meta</span> <span class="token cVar">charset</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>UTF-8<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span>
...
<span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>meta</span> <span class="token cVar">charset</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>UTF-8<span class="token cBase">"</span></span> <span class="token cBase">/&gt;</span></span></code></pre></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://blog.teamtreehouse.com/to-close-or-not-to-close-tags-in-html5" rel="noreferrer" target="_blank" title="What is a self closing tag? Interview Questions Source To Answer">blog.teamtreehouse.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 10. How Can I Get Indexed Better by Search Engines?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>It is possible to get indexed better by placing the following two statements in the <code>&lt;HEAD&gt;</code> part of your documents:</p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>META</span> <span class="token cVar">NAME</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>keywords<span class="token cBase">"</span></span> <span class="token cVar">CONTENT</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>keyword keyword keyword keyword<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span>
<span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>META</span> <span class="token cVar">NAME</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>description<span class="token cBase">"</span></span> <span class="token cVar">CONTENT</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>description of your site<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span></code></pre><p>Both may contain up to 1022 characters. If a keyword is used more than 7 times, the keywords tag will be ignored altogether. Also, you cannot put markup (other than entities) in the description or keywords list.</p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.freejavaguide.com/html-interview-questions.htm" rel="noreferrer" target="_blank" title="How Can I Get Indexed Better by Search Engines? Interview Questions Source To Answer">freejavaguide.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 11. Briefly describe the correct usage of the following HTML5 semantic elements: header, article, section, footer</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><ul><li><p><code>&lt;header&gt;</code> is used to contain introductory and navigational information about a section of the page. This can include the section heading, the author’s name, time and date of publication, table of contents, or other navigational information.</p></li><li><p><code>&lt;article&gt;</code> is meant to house a self-contained composition that can logically be independently recreated outside of the page without losing it’s meaining. Individual blog posts or news stories are good examples.</p></li><li><p><code>&lt;section&gt;</code> is a flexible container for holding content that shares a common informational theme or purpose.</p></li><li><p><code>&lt;footer&gt;</code> is used to hold information that should appear at the end of a section of content and contain additional information about the section. Author’s name, copyright information, and related links are typical examples of such content.</p></li></ul></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://www.w3schools.com/html/html5_semantic_elements.asp" rel="noreferrer" target="_blank" title="Briefly describe the correct usage of the following HTML5 semantic elements: `<header>`, `<article>`, `<section>`, `<footer>` Interview Questions Source To Answer">w3schools.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 12. hat's the difference between an "attribute" and a "property" in HTML?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>Attributes are defined on the HTML markup but properties are defined on the DOM. To illustrate the difference, imagine we have this text field in our HTML: <code>&lt;input type="text" value="Hello"&gt;</code>.</p><pre><code><span class="token cVar">const</span> input <span class="token cBase">=</span> document<span class="token cBase">.</span><span class="token cMod">querySelector</span><span class="token cBase">(</span><span class="token cString">'input'</span><span class="token cBase">)</span><span class="token cBase">;</span>
<span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>META</span> <span class="token cVar">NAME</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>description<span class="token cBase">"</span></span> <span class="token cVar">CONTENT</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>description of your site<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span></code></pre><p>Both may contain up to 1022 characters. If a keyword is used more than 7 times, the keywords tag will be ignored altogether. Also, you cannot put markup (other than entities) in the description or keywords list.</p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.freejavaguide.com/html-interview-questions.htm" rel="noreferrer" target="_blank" title="How Can I Get Indexed Better by Search Engines? Interview Questions Source To Answer">freejavaguide.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 11. Briefly describe the correct usage of the following HTML5 semantic elements: header, article, section, footer</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><ul><li><p><code>&lt;header&gt;</code> is used to contain introductory and navigational information about a section of the page. This can include the section heading, the author’s name, time and date of publication, table of contents, or other navigational information.</p></li><li><p><code>&lt;article&gt;</code> is meant to house a self-contained composition that can logically be independently recreated outside of the page without losing it’s meaining. Individual blog posts or news stories are good examples.</p></li><li><p><code>&lt;section&gt;</code> is a flexible container for holding content that shares a common informational theme or purpose.</p></li><li><p><code>&lt;footer&gt;</code> is used to hold information that should appear at the end of a section of content and contain additional information about the section. Author’s name, copyright information, and related links are typical examples of such content.</p></li></ul></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://www.w3schools.com/html/html5_semantic_elements.asp" rel="noreferrer" target="_blank" title="Briefly describe the correct usage of the following HTML5 semantic elements: `<header>`, `<article>`, `<section>`, `<footer>` Interview Questions Source To Answer">w3schools.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 12. What's the difference between an "attribute" and a "property" in HTML?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>Attributes are defined on the HTML markup but properties are defined on the DOM. To illustrate the difference, imagine we have this text field in our HTML: <code>&lt;input type="text" value="Hello"&gt;</code>.</p><pre><code><span class="token cVar">const</span> input <span class="token cBase">=</span> document<span class="token cBase">.</span><span class="token cMod">querySelector</span><span class="token cBase">(</span><span class="token cString">'input'</span><span class="token cBase">)</span><span class="token cBase">;</span>
console<span class="token cBase">.</span><span class="token cMod">log</span><span class="token cBase">(</span>input<span class="token cBase">.</span><span class="token cMod">getAttribute</span><span class="token cBase">(</span><span class="token cString">'value'</span><span class="token cBase">)</span><span class="token cBase">)</span><span class="token cBase">;</span> <span class="token cComment">// Hello</span>
console<span class="token cBase">.</span><span class="token cMod">log</span><span class="token cBase">(</span>input<span class="token cBase">.</span>value<span class="token cBase">)</span><span class="token cBase">;</span> <span class="token cComment">// Hello</span></code></pre><p>But after you change the value of the text field by adding "World!" to it, this becomes:</p><pre><code>console<span class="token cBase">.</span><span class="token cMod">log</span><span class="token cBase">(</span>input<span class="token cBase">.</span><span class="token cMod">getAttribute</span><span class="token cBase">(</span><span class="token cString">'value'</span><span class="token cBase">)</span><span class="token cBase">)</span><span class="token cBase">;</span> <span class="token cComment">// Hello</span>
console<span class="token cBase">.</span><span class="token cMod">log</span><span class="token cBase">(</span>input<span class="token cBase">.</span>value<span class="token cBase">)</span><span class="token cBase">;</span> <span class="token cComment">// Hello World!</span></code></pre></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://github.com/yangshun/front-end-interview-handbook/blob/master/questions/javascript-questions.md" rel="noreferrer" target="_blank" title="hat's the difference between an &quot;attribute&quot; and a &quot;property&quot; in HTML? Interview Questions Source To Answer">github.com/yangshun</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 13. When is it appropriate to use the small element?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>The HTML <code>&lt;small&gt;</code> element makes the text font size one size smaller (for example, from large to medium, or from small to x-small) down to the browser's minimum font size. In HTML5, this element is repurposed to represent side-comments and small print, including copyright and legal text, independent of its styled presentation.</p><p>Consider:</p><pre><code><span class="token cBool"><span class="token cBool"><span class="token cBase">&lt;</span>img</span> <span class="token cVar">src</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>image.jpg<span class="token cBase">"</span></span> <span class="token cVar">alt</span><span class="token cString"><span class="token cBase">=</span><span class="token cBase">"</span>London by night<span class="token cBase">"</span></span><span class="token cBase">&gt;</span></span>
Expand Down