8 BEST CSS INTERVIEW QUESTION AND ANSWERS

Given below are the 8 best CSS interview questions and answers.

 

  1. Name all the modules which are used in the current version of CSS.

Answer: The list of several modules in CSS is as given below.

Selectors

Box Model

Text Effects

Backgrounds and borders

2D/3D Transformations

Multiple column layouts

Animations

User Interface.

 

  1. Define use of embedded style sheet?

Answer: Embedded style sheet provides us the privilege to define styles at one place in an HTML document.

 

We can generate multiple classes using an embedded style sheet using on multiple tag types of a web page and also there is no extra downloading required for importing the information.

 

  1. Differentiate between CSS2 and CSS3.

Answer: The differences between CSS2 and CSS3 are:

  1. CSS3 modules are supported by almost every browser but all browsers do not support modules of CSS and CSS2.
  2. Many graphics related characteristics have been introduced such as flexbox, box-shadow and border-radius in CSS3.
  3. Multiple background images on a webpage can be precise by a user with properties like background-image, background-position along with background repeat styles in CSS3.
  4. CSS3 is divided into two various sections called as a module, but in CSS2 everything accedes into a single document with all the information in it.

 

  1. Explain the term Responsive web design.

Answer: It is a method of designing and developing a web page according to the user activities and conditions based on various components like portability of the web page on different device, the size of the screen and etc. done by using different flexible layouts and grids.

 

  1. Explain the concept of Tweening.

Answer: It is a process in which we can create intermediate frames between two images to get the appearance of the first image which develops into the second image and generally used for creating animations.

 

  1. How do we make a rounded corner by using CSS?

Answer: rounded corner can be created only by using the property “border-radius”. We can apply this property to any element.

 

Example as follows:

<html>

<head>

 

<style>

#rcorners1 {

border-radius: 25px;

background: #715751;

padding: 20px;

width: 200px;

height: 150px;

}

 

</style>

</head>

 

<body>

<h1>The border-radius Property</h1>

<p>Rounded corners for an element with a specified background color:</p>

<p id=”rcorners1″>Rounded corners!</p>

</body>

 

</html>

 

 

  1. What is the difference between padding and margin?

Answer: In CSS, the margin is considered as the property by which we can create space around elements. We can create space to the exterior defined borders.  In CSS we have margin property which is as follows:

  • margin-top
  • margin-right
  • margin-bottom
  • Margin-left

 

  1. What is the use of the Box Model in CSS?

Answer: The box model is a box that binds all the HTML elements including different features like margins, border, and padding along with the actual content.  By using box model we get authority to add the borders all around the elements and also able to define the space between the elements.

 

Leave a Reply

Your email address will not be published. Required fields are marked *