CSS-interview Question

+
CSS

1) What is the box model in CSS?

The box model in CSS describes how elements are structured and how their dimensions are calculated. It consists of the following components:

  • Content: The actual content of the box, such as text or images.
  • Padding: The space between the content and the border, which is transparent.
  • Border: A line that surrounds the padding and content.
  • Margin: The outermost space that separates the element from other elements, which is also transparent.


2) What is the difference between class and id selectors in CSS?

  • A class selector is used to select multiple elements and is defined with a dot (.) prefix. It can be applied to any number of elements on a page.
  • An id selector is unique and is used to select a single element, defined with a hash (#) prefix. Each id must be unique within a page, meaning it can only be assigned to one element.


What Our Students Saying

Companies Our Alumni Are Employed At

The alumni of Techpro Education have the opportunity to take their seats in leading companies in the IT industry. Prominent tech corporates hire our candidates for their challenging software tasks.

TechPro Education Huawei
TechPro Education Mavi Soft
TechPro Education PNC Bank
TechPro Education Avansas
TechPro Education ETIYA
TechPro Education Tech Mahindra
TechPro Education Infosys
TechPro Education Capgemini
TechPro Education Walmart
TechPro Education CapitalOne
TechPro Education Vanguard
TechPro Education ZLTECH
TechPro Education Best Buy
TechPro Education Accenture
TechPro Education Ziraat Bank


TechPro Education IBM
TechPro Education USB
TechPro Education Bank Of America
TechPro Education National Bank
TechPro Education Chase
TechPro Education Betclic
TechPro Education NEC
TechPro Education Mastercard
TechPro Education Defacto
TechPro Education Amazon
TechPro Education Vodofone
TechPro Education Mercedes
TechPro Education VISA
TechPro Education Porsche
TechPro Education The Hartford