15 Interview Question of CSS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

15 Interview Question of CSS

1. What is CSS?
Ans. CSS outlines the style of an HTML webpage. It is a language by which we can set the
behavior of an HTML webpage. It describes how the HTML content will be shown on
screen. CSS controls the layout of several HTML web pages. CSS is referred to as the
Cascading Style Sheet.
2. Name all the modules which are used in the current version of CSS.
Ans.
• Selectors
• Box Model
• Backgrounds and Borders
• Text Effects
• 2D/3D Transformations
• Animations
• Multiple Column Layout
• User Interface

3. Distinguish between CSS2 and CSS3.


Ans.
• CSS3 is divided into two various sections which are called a module. Whereas in CSS2
everything accedes into a single document with all the information in it.
• CSS3 modules are supported almost on every browser and on the other hand modules
of CSS and CSS2 are not supported in every browser.
• In CSS3, we will find that many graphics related characteristics have been introduced
like Border-radius or box-shadow, flexbox.

4. How to include CSS in the webpage?


Ans. => External Style Sheet
=> Embed CSS with a style tag
=> Add inline styles to HTML elements (CSS rules applied directly within an HTML
tag).

5.What are the different types of selectors ?


Ans. .Universal selector
.Element type selector
.Id selector
.Class selector
.Descendant Combinator
.Child Combinator
.General Sibling Combinator
.Adjacent Sibling Combinator
6.What is the differences between inline, block and inline-block element?

Ans. Block Element: The block elements always start on a new line. They will also take
space for an entire row or width. List of block elements are <div>, <p>.

Inline Elements: Inline elements don't start on a new line, they appear on the same line as
the content and tags beside them. Some examples of inline elements are <a>, <span> ,
<strong>, and <img> tags.

Inline Block Elements: Inline-block elements are similar to inline elements, except they can
have padding and margins and set height and width values.

7. What are Pseudo elements and pseuodo classes?

Ans. ::before , ::after , ::first-line , ::first-letter , ::section are pseudo elements . On the other
hand , :link, :visited, :hover ,:focus , :active are pseudo classes.

8. Describe all the position states in CSS.

Ans. There are four position states in CSS .They are : Static, Fixed , Relative , Absolute .
9. What are the most prominent frameworks in CSS?

Ans. Bootstrap, Foundation , Semantic UI , ULKit are the css frameworks.


10. Define the difference between ID and Class in CSS.

Ans. ID: It is a unique value assigned to any particular element. For every single element, only
one ID can be assigned. When a specific style tried to be achieved using CSS code ID is the best
option to define the style.
Class: A class can be used to identify more than one element in a CSS block. The HTML
elements can be targeted collectively using the class option. The class cannot be defined as
unique as multiple elements can belong to one particular class.
11. Define the RGB stream in CSS.

Ans. RGB is a collection of colour codes using which we can style our web page in CSS. RGB
represents three combinations that is RED, GREEN, BLUE streams. We can lift the intensity of
the colours up and down using the given range from 0 to 256. It allows us to use a wide
spectrum of colours using different colour codes.
12. What do you mean by a responsive web page?

Ans. The responsive web page is the modern concept in website designing. It allows the
websites to load and respond as per the user compatibility to visualize in their device. It takes
care of things like the size of the web page, portability, speed on the different device setup
such as laptop, mobile, and tabs.
13. What is Image scripting in CSS?

Ans. These are a group of images placed under one image. It increases the web pages’
response time by reducing the load caused by multiple images to load at a time into a single
webpage.
14. Define Gradients in CSS?

Ans. The gradient is the feature defines in CSS which allows two or more colours to create and
smooth transformed layer. CSS Proposes two types of gradient that are : linear gradient , radial
gradient .

15. What is the difference between padding and margin in CSS?

Ans. Margin and padding are the CSS properties that allow you to create defined space
between the container or div and the text. Margin is the defined space around the specified
element and padding is the space defined at the external border of the element.

You might also like