Top 10 HTML & CSS Interview Questions With Answers

What is the  difference between HTML elements & tags?

HTML elements communicate to the browser how to render text. When surrounded by angular brackets <> they form HTML tags, which come in pairs & surround the text.

What are the limitations when serving XHTML pages?

The main limitation is the poor browser support of XHTML. Internet Explorer & other user agents cannot parse XHTML as XML.  Thus, it is less extensible language than one might think.

What is the syntax difference between a bulleted list & numbered list?

The main limitation is the poor browser support of XHTML. Internet Explorer & other user agents cannot parse XHTML as XML.  Thus, it is less extensible language than one might think.

What are some new HTML5 markup elements?

Among several: <article>, <aside>, <bdi>, <command>, <details>, <figure>, <figcaption>, <summary>, <header>, <footer>, <hgroup>, <mark>, <meter>, <nav>, <progress>, <ruby>, <rt>, <section>, and <time>.

What are data- attributes good for?

Data– attribute is used to assign custom data to an element.  The stored (custom) data can then be used in the page’s JavaScript to create a more engaging user experience.

What are some of the major new APIs that come standard with HTML5?

Media API, Text Track API, Application Cache API, User Interaction, Data Transfer API, Command API, and the History API.

What is an image map?

An image map is a list of coordinates relating to a specific image, created to hyperlink areas of the image to different destinations (as opposed to a normal image link, in which the entire area of the image links to a single destination).

Do all HTML elements need both opening and closing tags?

Not really, elements like <img src=””/> or <input type=””/> don’t need a closing tag.

What is a marquee?

A marquee is used to enable scrolling text on a web page. So, to do this, just place whatever text you want to appear scrolling within the <marquee> and </marquee>tags.

Explain the CSS box model.

The CSS box model is made up of margins, borders, padding, and content. Furthermore, the box model provides a more structured way to space elements in relationship to each other in web pages.

Want to Explore more HTML & CSS Interview Questions and Answers?