• LOGIN
  • No products in the cart.

HTML5 & CSS3 Interview Questions and Answers

What is CSS?

The full form of CSS is Cascading Style Sheets. It is a styling language which is simple enough for HTML elements. It is popular in web designing, and its application is common in XHTML also.

What is the origin of CSS ?

Standard Generalized Markup Language marked the beginning of style sheets in 1980s.

What are the different variations of CSS ?

The variations for CSS are:

CSS 1

CSS 2

CSS 2.1

CSS 3

CSS 4

HTML5 and CSS Course

Differences Between SVG and Canvas:

SVG is a language for describing 2D graphics in XML.

Canvas draws 2D graphics, on the fly (with a JavaScript).

SVG is XML based, which means that every element is available within the SVG DOM. You can attach JavaScript event handlers for an element.

In SVG, each drawn shape is remembered as an object. If attributes of an SVG object are changed, the browser can automatically re-render the shape.

Canvas is rendered pixel by pixel. In canvas, once the graphic is drawn, it is forgotten by the browser. If its position should be changed, the entire scene needs to be redrawn, including any objects that might have been covered by the graphic.

Difference between Transitional and Strict doctype.

Strict : This DTD contains all HTML elements and attributes, but does NOT INCLUDE presentational or deprecated elements (like font). Framesets are not allowed.

Transitional : This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed.

What is the use of Canvas Element in HTML5?

HTML5 Canvas element can be used to draw graphics images on a web page by using javascript.

What is the purpose of HTML5 versus XHTML?

HTML5 is the next version of HTML 4.01, XHTML 1.0 and DOM Level 2 HTML. It aims to reduce the need for proprietary plug-in-based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, Apache Pivot, and Sun JavaFX. Instead of using those plugins, it enables browser to serve elements such as video and audio without any additional requirements on the client machine.

What are CSS frameworks?

It is a pre-planned libraries, which allows easier and more standards-compliant webpage styling, using CSS language.

Who maintains the CSS specifications?

World Wide Web Consortium maintains the CSS specifications.

In how many ways can a CSS be integrated as a web page?

CSS can be integrated in three ways:

Inline: Style attribute can be used to have CSS applied HTML elements.

Embedded: The Head element can have a Style element within which the code can be placed.

Linked/ Imported: CSS can be placed in an external file and linked via link element.

What is the use of localStorage in HTML5?

Ans: Before HTML5 LocalStores was done with cookies. Cookies are not very good for large amounts of data, because they are passed on by every request to the server, so it was very slow and in-effective.

In HTML5, the data is NOT passed on by every server request, but used ONLY when asked for. It is possible to store large amounts of data without affecting the website’s performance.and The data is stored in different areas for different websites, and a website can only access data stored by itself.

What purpose does HTML5 serve?

HTML5 is the proposed next standard for HTML 4.01, XHTML 1.0 and DOM Level 2 HTML. It aims to reduce the need for proprietary plug-in-based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, Apache Pivot, and Sun JavaFX.

What is the difference between HTMl5 Application cache and regular HTML browser cache?

HTML5 specification allows browsers to prefetch some or all of a website assets such as HTML files, images, CSS, JavaScript, and so on, while the client is connected. It is not necessary for the user to have accessed this content previously, for fetching this content. In other words, application cache can prefetch pages that have not been visited at all and are thereby unavailable in the regular browser cache. Prefetching files can speed up the site’s performance, though you are of course using bandwidth to download those files initially.

HOW DO YOU PLAY A AUDIO USING HTML5?

We can display audio using the tag as shown below:

<audio controls=“controls”>

<source src=“test.mp3″ type=“audio/mp3″ />

</audio>

Differentiate logical tags from physical tags?

While physical tags are also referred to as presentational mark-up, logical tags are useless for appearances.

Physical tags are newer versions while logical tags are old and concentrate on content.

Differentiate Style Sheet concept from HTML?

While HTML provides easy structure method, it lacks styling, unlike Style sheets. Moreover, style sheets have better browser capabilities and formatting options.

HTML5 and CSS Course

Comment on the Case-sensitivity of CSS ?

Although, there are no case-sensitivity of CSS, nevertheless font families, URL’s of images, etc is. Only when XML declarations along with XHTML DOCTYPE are being used on the page, CSS is case -sensitive.

 Define Declaration block?

A catalog of directions within braces consisting of property, colon and value is called declaration block.

What is the major improvement with HTML5 in reference to Flash?

Flash is not supported by major mobile devices such as iPad, iPhone and universal android applications. Those mobile devices have lack of support for installing flash plugins. HTML5 is supported by all the devices, apps and browser including Apple and Android products. Compared to Flash, HTML5 is very secured and protected. That eliminates major concerns that we have seen with Flash.

WHAT OTHER ADVANTAGES DOES HTML5 HAVE

  1. a) Cleaner markup
  2. b) Additional semantics of new elements like <header>, <nav>, and <time>
  3. c) New form input types and attributes that will (and in Opera’s case, do) take the hassle out of scripting forms.
January 25, 2020
GoLogica Technologies Private Limited  © 2019. All rights reserved.