Front End Developer Interview Questions Html Questions: Flashcards
What does a doctype do?
The doctype declaration should be the very first thing in an HTML document, before the tag. The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in. The doctype declaration refers to a Document Type Definition (DTD)
What's the difference between full standards mode, almost standards mode and quirks mode?
Quirks mode: In quirks mode, layout emulates nonstandard behavior in Navigator 4 and IE 5. These were needed for websites written before introduction of web standards. Full standard mode: In this mode, the behavior described is same as described by HTML and CSS specifications. Most of the modern browsers uses full standard mode. Almost standard Mode: In almost standard mode there is very small number of quirks implementation.
What's the difference between HTML and XHTML?
You should use XHTML if you need the syntax checking and the strict structure that XML impose. ... The Extensible Hypertext Markup Language, or XHTML, is a markup language that has the same depth of expression as HTML, but also conforms to XML syntax. XHTML is "the modern version of HTML 4"
Are there any problems with serving pages as application/xhtml+xml?
When a browser reads XML it uses an XML parser, not an HTML parser. Unfortunately, up to and including version 8, Internet Explorer doesn't support files served as XML, although a number of other browsers do
How do you serve a page with content in multiple languages?
The browser writes a value for the Accept-Language request header field that it sends to the web server. You can set this value in Preferences (Mozilla) or Internet Options (Internet Explorer). If you choose multiple languages, they are sent to the server as a comma-delimited list in your preferred order
What kind of things must you be wary of when design or developing for multilingual sites?
Properly localizing content for different audiences based on their location, as well as allowing for a user to easily change their country/language.
What are data- attributes good for?
Storing data in HTML for DOM parsing, or other ways of keeping track of information.
Consider HTML5 as an open web platform. What are the building blocks of HTML5?
This question is a bit confusing, as when you say building blocks, my head goes to block elements. The HTML5 specific ones are:<article><aside><audio><canvas><figcaption><figure><footer><header><hgroup><output><section><video>
Describe the difference between a cookie, sessionStorage and localStorage.
Cookie:Max size of 4093 bytesCan set expiration dateSent on every requestsessionStorage:Max size of 2.5MBs+ depending on browserStored in browser and not sent with every requestIf you close a tab using sessionStorage, open a new tab, or exit the browser - you'll lose that specific sessionStorage data.localStorage:Max size of 2.5MBs+ depending on browserStored in browser and not sent with every requestWill persist if browser/tabs are closed.
Describe the difference between <script>, <script async> and <script defer>
A regular <script> tag will block rendering of the page, and the page will not continue to load until the script finishes.<script async> will run the script asynchronously, meaning that it will not block rendering, but will run as soon as the script is available. This is usually intended for CDN files, or other such files, which do not change the page structure.<script defer> will defer the script to run after the page is done parsing and before an onload event.
Why is it generally a good idea to position CSS <link>s between <head></head> and JS <script>s just before </body>? Do you know any exceptions?
You usually put the <link> tags in between the <head> to prevent Flash of Unstyled Content which gives the user something to look at while the rest of the page is being parsed.Since Javascript blocks rendering by default, and the DOM and CSSOM construction can be also be delayed, it is usually best to keep scripts at the bottom of the page.Exceptions are if you grab the scripts asynchronously, or at least defer them to the end of the page.
What is progressive rendering?
With HTML progressive rendering is chunking the HTML into separate bits and loading each block as it's finished. Usually, the backend code loads the HTML at once, but if you flush after finishing one part of the structure, it can be rendered immediately to the page.This can be done asynchronously with different components being loaded as they finish. There's new features which can be used with Web Components making it more standard. Another interesting article on this is from eBay with Async Fragments.
different HTML templating languages
1. Mustache2.Handlebars3.EJS4.pug5.JSX