Frontend track

HTML and CSS interview questions

Panel-ready Frontend Master questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.

1 Easy CSS Frontend

What is the CSS box model?

Short take Full answer on next page

Simple meaning

The box model is how the browser sizes an element: content, then padding, then border, then margin outside.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
2 Easy CSS Frontend

Why do teams set box-sizing to border-box?

Short take Full answer on next page

Simple meaning

With content-box, padding and border sit on top of width so a 200px card can overflow its parent.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
3 Easy CSS Frontend

How is margin different from padding?

Short take Full answer on next page

Simple meaning

Padding is space inside the border, so the background still covers it.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
4 Easy CSS Frontend

What does display flex do?

Short take Full answer on next page

Simple meaning

Flexbox lays out children in a row or column and lets you align, wrap, and distribute leftover space.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
5 Easy CSS Frontend

When would you use CSS Grid instead of Flexbox?

Short take Full answer on next page

Simple meaning

Grid is for two-dimensional layouts where rows and columns must line up, like a dashboard or photo gallery.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
8 Easy CSS Frontend

How does z-index work?

Short take Full answer on next page

Simple meaning

Z-index only applies to positioned elements, or those with certain properties that create a stacking context.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
9 Easy HTML Frontend

What is semantic HTML and why does it matter?

Short take Full answer on next page

Simple meaning

Semantic tags like header, nav, main, and button describe meaning, not just boxes.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
11 Easy HTML Frontend

Why should images have an alt attribute?

Short take Full answer on next page

Simple meaning

Alt describes the image for screen readers and when the file fails to load.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
13 Easy HTML Frontend

What does the viewport meta tag do on mobile?

Short take Full answer on next page

Simple meaning

It tells the phone not to pretend the screen is a wide desktop and then zoom out.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
14 Easy Accessibility Frontend

What does ARIA mean at a high level?

Short take Full answer on next page

Simple meaning

ARIA attributes tell assistive tech the role, name, and state of custom widgets when native HTML is not enough.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
15 Easy Accessibility Frontend

Why is keyboard navigation important?

Short take Full answer on next page

Simple meaning

Many users cannot use a mouse, including power users and people with motor disabilities.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
17 Easy CSS Frontend

What are media queries used for?

Short take Full answer on next page

Simple meaning

They apply CSS only when the viewport or device matches a condition, usually min-width.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
19 Easy HTML Frontend

Why is using div for everything a bad habit?

Short take Full answer on next page

Simple meaning

Divs have no meaning, so screen readers and outline tools cannot find nav, headings, or lists.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
20 Easy CSS Frontend

What is the difference between em and rem?

Short take Full answer on next page

Simple meaning

Em is relative to the parent font-size, so it compounds in nested components.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
Page 1 of 3 Next
Chat with us