Interview
Question
Sr.No Topic Number of Questions
1 Basic CSS 10
2 Selectors 4
3 CSS Box Model 7
4 Layout 8
5 Typography 7
6 Colors and Backgrounds 9
7 CSS Transition 5
8 CSS Animation 5
9 CSS Transform 10
10 CSS Flex 8
11 Grid Layout 10
12 Responsive Design 8
Total 91
Prepared by – Vinayak Kittad | LinkedIn | Github Profile| Portfolio
,Here are 99 CSS questions that cover a wide range of Q.5] What are the different ways to apply CSS
topics, including theory, concepts, and practical
questions. These questions will help you prepare to a web page?
effectively for an interview.
CSS can be applied in three ways:
Basic CSS
1. Inline styles: Directly within an HTML element.
2. Internal stylesheets: Within a <style> element in
the <head> section of an HTML document.
3. External stylesheets: inked to an HTML document
Q.1] What does CSS stand for? using the <link> element.
• CSS stands for Cascading Style Sheets. Q.6] What is an inline style?
Q.2] What is the purpose of CSS? • Inline styles are CSS styles applied directly to an
individual HTML element using the style attribute
• CSS is used to style and format the appearance of
web pages written in HTML and XML.
• It allows web developers to control aspects like
layout, colors, fonts, and spacing of HTML Q.7] What is an internal stylesheet?
elements.
• An internal stylesheet is CSS code written within a
Q.3] How do you link a CSS file to an HTML <style> element in the <head> section of an
document? HTML document.
• It applies styles to that particular HTML document
• You can link a CSS file to an HTML document using only.
the <link> element within the <head> section of
the HTML document. Q.8] What is an external stylesheet?
• An external stylesheet is a separate CSS file
linked to an HTML document using the <link>
• rel – It is used to indicate different relationships element.
between the current document and the linked • It allows styles to be applied across multiple
resource. Some common values are HTML documents.
- stylesheet
Q.9] How do you apply multiple styles to a
- icon
- preload single element?
- alternate
• Multiple styles can be applied to a single element
• type – The type attribute specifies the MIME
by separating each style declaration with a
type of the linked resource.
semicolon within the style attribute (for inline
Q.4] What is the syntax of a CSS rule? styles) or within the CSS rule:
• A CSS rule consists of a selector and a
declaration block.
Prepared by – Vinayak Kittad | LinkedIn | Github Profile| Portfolio
, ✓ Selects all elements of a specific type
Q.10] What is the difference between a class
selector and an ID selector?
Class selector
• Defined using a dot (.) followed by a class name.
• Classes can be applied to multiple elements, and
one element can have multiple classes.
3. Class Selector (.)
✓ Selects elements with a specific class
attribute
4. ID Selector (#)
ID selector ✓ Selects a single element with a specific
• Defined using a hash (#) followed by an ID name. ID attribute
• IDs are unique within a document and should only
be applied to one element.
5. Attribute Selector
✓ Selects elements based on the presence
or value of an attribute.
Selectors
Q.11] What is a CSS selector?
• A CSS selector is a pattern that is used to select 6. Pseudo-classes
and style HTML elements based on various ✓ Selects elements based on their special
criteria such as element types, IDs, classes, state
attributes, and relationships with other
elements
Q.12] What are the types of CSS Selectors
1. Universal Selector (*)
✓ Selects all elements on the page
7. Pseudo-elements
✓ Selects specific parts of an element's
content
2. Type Selector
Prepared by – Vinayak Kittad | LinkedIn | Github Profile| Portfolio