×

Top 30 CSS Interview Questions for 2024

1) Define the process where block elements can be centered with css.

It can be centered by using margin-left and margin-right properties we can centered the block level elements.

2) Name the authority which maintain the CSS Specification.

World Wide Web Consortium maintains CSS Specification.

3) Is CSS case-sensitive or not ?

CSS only there is no case-sensitive but when XML declaration along with XHTML DOCTYPE then it is case sensitive.

4) How can we select the paragraph whose language is "french" only?

In paragraph if we type p[lang~="fr"] then it select all paragraph with lang attribute=fr.

5) Describe Overriding in CSS Style.

  1. Since, inline style sheet have Highest property therefore it will override all rules defined in <style>...</style> tags.
  2. Rule which are defined in <style> tags will override the rules specify in any external style sheet file.
  3. External Style Sheet has the lowest priority thus, it is executed only when above rules not applicable.

6) Define Browser Safe Color?

Color ranges from- Hexacode 000000 to FFFFFF i.e. all 216 color as assumed all computer run on 256 color palette.

7) Difference between Class selector and ID selector.

Difference is based upon the application of style i.e. Class selector apply style using "Class" whereas ID Selector using "ID".

8) Does Multiple Declaration exist in CSS?

Yes, with the help of semi-colon(;).

9) Define Pseudo-elements.

In some cases extra styling/markup is not possible then we uses Pseudo Elements to add special effect to some selector.
eg. A {  //Pseudo-elements  

    text-decoration: none;  

      }  

<A href="tutorialandexample.html" style="text-decoration: none">Your text</A>

10) Give the list of all Media type used.

  1. Print: gives a preview of the content when printed
  2. Aural: for sound synthesizers and speech
  3. Handheld: uses handheld devices.
  4. Screen: computers and laptop screens
  5. Projection: projects the CSS on projectors.

11) Define CSS Box Model & its Elements ?

CSS Box Model is used for Design and Layout of element of CSS which are Margin,Border,Content,Padding.

12) What is the use of Z index function?

It is used to specify the overlapping element which occur when CSS is used for positioning HTML elements.

13) In how many ways can a CSS be integrated as a web page?

CSS can be integrated in three ways:
  1. Inline: gives a preview of the content when printed
  2. Embedded:Style attribute can be used to have CSS applied HTML elements.
  3. Linked:The Head element can have a Style element within which the code can be placed.
  4. Screen:CSS can be placed in an external file and linked via link element.

14) What are the benifits do external CSS have??

Benifits are as follows:
  • One file can be used to control multiple documents having different styles.
  • Multiple HTML elements can have many documents, which can have classes.
  • To group styles in composite situations, methods as selector and grouping are used.

15) What are the demerit do external CSS have??

Demerits are as follows:
  • Extra download is needed to import documents having style information.
  • To render the document, the external style sheet should be loaded.
  • Not practical for small style definitions.

16) Explain media types in CSS?

The design and customization of documents are rendered by media. By applying media control over the external style sheets, they can be retrieved and used by loading it from the network.

17) Describe ruleset in CSS?

Ruleset is an identifier which identifies selectors which are attached to other selectors

18) Define Declaration block?

A catalog of directions within braces consisting of property, colon and value is called declaration block. e.g.: [property 1: value 3]

19) What is the use of Class selector?

Selectors that are unique to a specific style, are called C selectors. Declaration of style and association with HTML is done with class selector.

20) What is Pseudo-elements ?

Pseudo-elements are used to add special effects to some selectors. CSS is used to apply styles in HTML mark-up. In some cases when extra mark-up or styling is not possible for the document, then there is a feature available in CSS known as pseudo-elements.

21) What is the use of Class selector?

Selectors that are unique to a specific style, are called C selectors. Declaration of style and association with HTML is done with class selector.

22) What is contextual selector?

Selector used to select special occurrences of an element is called contextual selector. A space separates the individual selectors.

23) What is graceful degradation?

It is described as when the content fails it will continue to work properly in the presence of a graceful degradation. The latest browser application is used when a webpage is designed.

24) What is progressive enhancement?

It's an alternative to graceful degradation, which concentrates on the matter of the web. The functionality is same, but it provides an extra edge to users having the latest bandwidth.

25) Define Attribute Selector ?

It is defined by a set of elements, value and its parts known as attribute selector.

26) What is Alternate Style Sheet?

Alternate Style Sheets allows the user to select the style in which the page is displayed using the view:page style menu. Through Alternate Style Sheet, user can see a multiple version of the page on their needs and preferences.

27) Enlist the various Media types used?

  • Aural- for sound synthesizers and speech
  • Print- gives a preview of the content when printed.
  • Projection- projects the CSS on projectors.
  • Handheld- uses handheld devices.
  • Screen- computers and laptop screens.

28) Enlist the various fonts attributes?

  • Font-style
  • Font-variant
  • Font-weight
  • Font-size/line-height
  • Font-family
  • Caption
  • Icon

29)What is at-rule?

Rule, which is applicable in the entire sheet and not partly, is known as at-rule. It is preceded by @ followed by A-Z, a-z or 0-9.

30) Enist out the properties of transition in CSS3?

  • Transition-delay
  • Transition-property
  • Transition-duration
  • Transition-timing-function

Related Topics

Flutter Interview Questions

Here’s a list of top Flutter questions that are frequently asked. Q1.  Is Flutter an open-source? A1.  Yes, Flutter is a 100% open-source software development kit. Q2.  What are flutter widgets? A2.  Widgets are...

7 minutes read.

Top 25 jQuery Interview Questions for 2024

Most Frequently asked jQuery Interview Questions and Answers for Fresher and Experienced 1) Define Find and Children Method? In DOM tree if you have to find all the method we use Find...

4 minutes read.

Top 30 Ruby on Rails Interview Questions for 2024

1) What is Ruby on Rails? It is a server-side web application framework. It is an open source ruby framework which is used for developing database-backed web applications. Here, no compilation phase is...

4 minutes read.

Top 15 Foundation Interview Questions for 2024

1) What is Foundation? Foundation is a front-end framework that is for designing beautiful responsive websites. This framework is compatible with all types of devices and provides you with HTML, CSS...

2 minutes read.

Top 18 Blockchain Interview Questions and Answers for 2024

Top 20 Commonly Asked Blockchain Interview Questions and Answers 1. What do you understand by Blockchain? Blockchain is a chain of blocks made up of digital pieces of information or can be defined as...

6 minutes read.

Top 40 IoT Interview Questions and Answers in 2024

Q.1 What is IoT? IoT stands for the Internet of things refers to the interconnection of the network of various devices that can recognize, collect and transfer data over the internet...

13 minutes read.

Top 15 Pure CSS Interview Questions for 2024

1) What is Pure CSS? Pure is a CSS (Cascading Style Sheet) framework. It is a collection of small set of responsive CSS modules. We can integrate it to any web...

5 minutes read.

Top 15 Euphoria Interview Questions for 2024

1) What is Euphoria? Euphoria is a programming language. It is open source, powerful and easy to learn. It stands for End-User Programming with Hierarchical Objects for Robust Interpreted Applications 2) Who...

2 minutes read.

Top 15 Bootstrap Interview Questions for 2024

1) Explain what is Bootstrap? It is a Framework which is used for building the web application with minimal effort. Bootstrap is also used for developing responsive, mobile-first web sites. 2) What...

10 minutes read.

Top 16 Groovy interview Questions for 2024

1) What is Groovy? Groovy is an object oriented programming language. It is based on java platform. It can also be used as scripting language. 2) Who designed the Groovy? James Strachan designed...

2 minutes read.

Top 25 MongoDB interview Questions for 2024

1) Give some history about MongoDB. MongoDB came into existence when data increased exponentially on the internet. Thus, maintainence of database became very difficult in structured DB. MongoDB is a NoSQL...

3 minutes read.

Top 30 Less Interview Questions for 2024

1) What is Less? Less is a dynamic style sheet language that can be compiled in to CSS (Cascading style Sheet). It runs on client side and server side. It is...

4 minutes read.

Top 30 Flex Interview Questions for 2024

1) What is Flex? Flex is an open source framework which is used to build applications for mobile, browser and desktop. It provides FLEX SDK consisting of the Flex class library, Flex...

4 minutes read.

Top 28 Angular 2 Interview Questions for 2024

1) What is Angular 2? It is an open source JavaScript framework which is used to build web applications in JavaScript and HTML. It is also used to overcome obstacles encountered while...

4 minutes read.

Top 31 CakePHP Interview Questions for 2024

1) What is CakePHP? CakePHP is an open-source PHP framework. It is used to develop dynamic web applications. It helps to developers to work in a structured manner. 2) When cakePHP was...

5 minutes read.

Top 30 Fortran Interview Questions for 2024

1) What is Fortran? Fortran is general purpose, high-level programming language which is used for numeric and scientific computing. 2) What are the features of Fortran programming language? Features of Fortran language are: ...

4 minutes read.

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 16 Moo Tools Interview Questions for 2024

1) What is Moo Tools? MooTools stands for My Object-Oriented Tools. It is a lightweight and object-oriented JavaScript framework. It is used to create dynamic web page. It is developed by Valerio...

5 minutes read.

Top 32 Laravel Interview Questions for 2024

1) What is Laravel? Laravel is an open source PHP framework. It is used to design and develop web applications. It is based on MVC (Model-View-Controller) design pattern. It is created by Taylor...

6 minutes read.

Artificial Neural Network Interview Questions

1. Explain Neural Network?  Neural Network is a sequence of an algorithm that gives its best to recognize the underlying relationship in a data-set through a process. The artificial neural network...

8 minutes read.