top 30 popular css interview questions and answers for students
GAUTAM SHARMA
@gauti123456
@geekygautam1997
š YOUTUBER & CODINGSHIKSHA.COM
šØāš» WEB DEVELOPER
šIndia
1) what is css?
Answer: CSS outline 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
Answer: There are several modules in CSS as stated below:
- Selectors
- Box Model
- Backgrounds and Borders
- Text Effects
- 2D/3D Transformations
- Animations
- Multiple Column Layout
- User Interface.
3) Distinguish between CSS2 and CSS3
- CSS3 is divided into two various sections which are called as 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) Cite different types of CSS
There are three types of CSS as mentioned below.
- External ā These are written in separate files.
- Internal ā These are cited at the top of the web page code document.
- Inline āĀ These are written right next to the text.
5) why is external stylesheet useful?
External style sheet is very useful as we write all the styling codes in a single file and it can be used anywhere by just referencing the link of that external style sheet file.
6) What are the uses of embedded style sheet
Embedded style sheet gives us the privilege to define styles at one place in an HTML document.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p {
font-family: georgia, serif;
font-size: x-large;
color:#ff9900;
}
a:hover {
color: LimeGreen;
text-decoration: none;
}
</style>
</head>
<body>
<p>Embedded style sheet gives us the privilege to define styles at one place in a HTML document.
We can generate multiple classes using embedded style sheet to use on multiple tag types a web page
and also there is no extra downloading required importing the information.
</p>
</body>
</html>7) How to use CSS selector?
By using CSS selector, we can choose the content which we want to style so that we can say that it is a bridge between the style sheet and the HTML files.
The syntax for CSS selector is āselectā HTML elements created on their id, class, type etc.
8) Explain the concept of Tweening.
Tweening is the process in which we create intermediate frames between two images to get the appearance of the first image which develops into the second image.
It is mainly used for creating animation.
9) Define CSS image scripts.
CSS image scripts is a group of images which is placed into one image.
It reduces the load time and request number to the server while projecting multiple images into a single web page.
10) Explain the term Responsive web design.
It is a method in which we design and develop a web page according to the user activities and conditions which are based on various components like the size of the screen, portability of the web page on different device etc.
11) What are CSS counters?
CSS counters are variables which can be incremented by rules of CSS that inspector track how many times the variable has been used.
12) What is CSS specificity?
CSS specificity is a score or rank that decides which style declaration has to be used to an element.
(*) this universal selector has low specificity while ID selectors have high specificity.
There are four categories in CSS which authorized the specificity level of the selector.
- Inline style
- IDs
- Classes, Attributes, and pseudo-classes.
- Elements and pseudo elements.
13) how can we calculate specificity?
To calculate specificity we will start with 0, then we have to add 1000 for each ID and we have to add 10 to the attributes, classes or pseudo-classes with each element name or pseudo-element and later we have to add 1 to them.
h2
#content h2
<div id=ācontentā>
<h2 style=ācolor:#FF0000ā>heading</h2>
</div>
14) how can we make a rounded corner in css?
We can make a rounded corner by using the property āborder-radiusā. We can apply this property to any element.
#rcorners1 {
border-radius: 25px;
background: #715751;
padding: 20px;
width: 200px;
height: 150px;
}15) how you will add border images to html element?
We can set the image to be used as the border image alongside an element by using the property of CSS āborder-imageā.
#borderimg {
border: 15px solid transparent;
padding: 20px;
border-image: url(border.png) 30 round;
}16) what are gradients in css?
It is a property of CSS which allows you to display a smooth transformation between two or more than two specified colors.
There are two types of gradients that are present in CSS. They are:
- Linear gradient
- Radial Gradient
17) What is CSS flexbox?
It allows you to design a flexible responsive layout structure without using any float or positioning property of CSS. To use CSS flexbox you need to define a flex container initially.
<style>
.flex-container {
display: flex;
background-color: #f4b042;
}
.flex-container > div {
background-color: #d60a33;
margin: 10px;
padding: 20px;
font-size: 30px;
}
</style>18) how to align the image vertically?
It can be done by using the syntax verticle-align: middle in the <div1> element and even we can bind the two text spans around with another span and after this, we have to use verticle-align: middle in the content #icon.
19) What is the difference between padding and margin?
In CSS, the margin is the property by which we can create space around elements. We can even create space to the exterior defined borders.
In CSS we have margin property as follows:
- margin-top
- margin-right
- margin-bottom
- Margin-left
In CSS, padding is the property by which we can generate space around an elementās content as well as inside any known border.
CSS padding also has properties like,
- Padding-top
- Padding-right
- Padding-bottom
- Padding-left
20) What is the use of the Box Model in CSS?
In CSS, the box model is a box that binds all the HTML elements and it includes features like margins, border, padding, and the actual content.
By using box model we will get the authority to add the borders all around the elements and we can also define the space between the elements.
21) how can we add icons to the web page?
We can add icons to the HTML webpage by using an icon library like font-awesome.
We have to add the name of the given icon class to any inline HTML element. (<i> or <span>) . Icons in the icon libraries are scalable vectors that can be customized with CSS.
22) What is a CSS pseudo class?
It is a class which is used to define a special state of an HTML element.
This class can be used by styling an element when a user snooped over it and also it can style an HTML element when it gets the focus.
selector:pseudo-class {
property:value;
}23) why is external stylesheet useful?
External style sheet is very useful as we write all the styling codes in a single file and it can be used anywhere by just referencing the link of that external style sheet file.
24) What is a CSS pseudo class?
It is a class which is used to define a special state of an HTML element.
This class can be used by styling an element when a user snooped over it and also it can style an HTML element when it gets the focus.
selector:pseudo-class {
property:value;
}25) Explain the concept of pseudo-elements in CSS.
It is a feature of CSS which is used to style the given parts of an element.
selector::pseudo-element {
property:value;
}26) What is CSS opacity?
It is the property which elaborates the transparency of an element.
By this property, we can transparent the image that can take the values from 0.0-1.0, if the value is lower then the image is more transparent. IE8 and earlier version of the browser can take the values from 0-100
img {
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */}27) Write all the position states used in CSS.
In CSS, there are four position states as stated below:
- Static(default)
- Relative
- Fixed
- absolute
28) what are navigation bars in css?
By using navigation bars we can make an ordinary HTML page into a user-specific and more dynamic web page.
Basically, it is a list of links, hence use of <ul> and <li> elements makes the perfect sense.
ul {
list-style-type: none;
margin: 0;
padding: 0;
}29) What are the differences between relative and absolute in CSS?
The main difference between relative and absolute is that ārelativeā is used for the same tag in CSS and it means that if we write the left:10px then the padding will shift to 10px in the left while absolute is totally relative to the non-static parent.
It means if we write left:10px then the result will be 10px far from the left edge of the parent element.
30) Define āimportantā declarations used in CSS.
Important declarations are defined as that declaration which is having more importance than the normal declaration.
While executing, these declarations override the declaration which is having less importance.
Example,Ā if there are two users Having important declaration then one of the declarations will override the declaration of another user.
For Example:
Body {background: #FF00FF !important; color: blue}
In this body background has more weight than the color.
2) google developers(1.5m)

3) derek banas (840k subs)

4) traversy media (700k subs)

5) LearnCODE.ACADEMY (500K)

6) kudvenkat (350k subs)

7) mycodeschool (327k subs)

8) codecourse (302k subs)

9) devtips (292k subs)

10) leveluptuts+ (248k subs)

11) treehouse (203k subs)

12) adam khoury (179k subs)

13) LearnWebcode (179k subs)

14) slidenerd (170k subs)

15) quentin watt (128k subs)

16) cave of programming (100k)

17) academind (280k subs)

18) programming with mosh 318k

19) hitesh choudhary (331k subs)

20) telusko (443k subs)

21) programmingknowledge 900

22) freecodecamp.org (798k)

23) durga software (500k subs)

24) the net ninja (261k subs)

25) techsith (62k subs)

26) the coding train (752k subs)

27) cs dojo (848k subs)

28) clever programmer (328k)

29) techlead (248k subs)

30) well code (12k subs)

thanks for watching
css interview
questions and answers for students
please like share and subscribe! š
Copy of Copy of Copy of Copy of Making your Vue apps faster by being lazy
By Coding Shiksha
Copy of Copy of Copy of Copy of Making your Vue apps faster by being lazy
We keep shipping more and more features in our Web applications, and as a result, we ship heavier apps that take more time to load. So we use bundlers like webpack to split our application code into multiple bundles and load them asynchronously. As a result, we end up having asynchronous code pretty much everywhere in our apps. This means that we need to handle unexpected errors that were otherwise impossible, like network ones, handle loading state and make sure the application is able to recover from these errors. During this talk, we will take a look at different patterns about handling asynchronous request correctly in Vue applications in order to make our Apps feel light, fast and reliable everywhere.
- 127