CSS Interview Questions and Answers
CSS Interview Questions and Answers
DEVELOPER UPDATES
CSS INTERVIEW QUESTIONS AND ANSWERS
What is CSS?
CSS (Cascading Style Sheet) is a simple design language used to
describe the look and formatting of a document written in a
markup Language. It is combined with markup languages i.e.
HTML & XHTML.
Using CSS we can change the color of the text, font styling,
layout designs, add/ reduce spacing, add different effects for
different devices and screen sizes and many more formatting.
What is Stylesheet?
A stylesheet is used to build a consistent, transportable and
well-designed style template. It describes the look and
formatting of the document.
What is the latest version of CSS?
CSS basically consists of many drafts for upcoming Standards.
CSS3 is the latest version of CSS. It helps you to control the
styling of the website.
Explain the new features in CSS3.
CSS basically consists of many drafts for upcoming Standards.
CSS3 includes some new features like New Selectors, CSS
Variables and functions, Gradients, Opacity, Transitions,
Transformation, Animations, FlexBox, Grid, and Media Queries.
Explain Different Types of Selectors
CSS selectors are used to find the particular HTML element
which you want to style or represent it in a different form.
3. Inline also begins on the same line itself and it has content
or tags before or after it.
Example - <a>, <span>
Disadvantages:
1. External documents need to be imported that carry different
styles information.
2. To render your document you need to load external CSS first.
What are the advantages and disadvantages of an
embedded stylesheet?
Advantages:
Classes can be created to use on various HTML tag types in
the document.
Selector and grouping methods can be used to apply styles
under complex contexts
No additional downloads necessary to receive style
information
Disadvantages:
This method can not control styles for multiple documents
at once
Explain gradient with example
CSS Gradient basically represents a transition between two or
more colors. It is a very important aspect to beautify and add
them to your content.
Padding
Content
Margin Element(div,span,p,etc)
z-index: 2
z-index: 3
z-index: 2
z-index: 3
z-index: 4
This is done by designing and coding the site so that its layout,
images, and other parts change automatically to fit the size of
the screen being used to view it.
There are two main ways to do this: using keyframes and using
transitions.
keyframe name
1.EM:
The percentage of em is relative to the font-size of the parent
element.
2. REM:
REM stands for Root EM, meaning it's relative to the root
element of the page (usually HTML).
For instance, let's say you want to create a container that will
occupy 50% width of the window. If you set the width to 50rem,
it will occupy 50% of the width of the viewport.
Key differences:
On the other hand, REMs are a better option if you need to size-
up structural elements like margins or padding based on the
root font-size.
DEVELOPER UPDATES 21
WWW.DEVELOPERUPDATES.COM
Stay ahead with daily updates!
Follow us on social media for useful web
development content.
@richwebdeveloper
@new_javascript
@developerupdates
@developerupdates
@_chetanmahajan
Download on Gumroad
WWW.DEVELOPERUPDATES.COM