CSS interview questions and Answers
Cascading Style Sheets (CSS) is a style sheet language or a mechanism used for enhancing its style by adding colors, fonts, and spacing to your web documents. We have a collection of CSS interview questions that helps in crack your interviews. It is designed to enable the separation of content for improving content accessibility and providing more flexibility in the specification of presentation and reducing complexity in the structural content. The specifications of CSS are maintained and managed by the W3C.
Most Frequently Asked CSS interview questions
Margin is a outer space of an element but padding is the inner space of an element. In other words we can say margin is the space outside of an element's border but padding is the space inside of its border.
It is a collection of images put into a single image. A page with many images can take a long time to load and generates multiple server requests. Using sprites will reduce the number of server requests and save bandwidth.
a[href="#"] {
color:red;
}
In CSS, a Class
selector is a name preceded by a full stop (".") and an ID
selector is a name preceded by a hash("#"). Difference between an ID
and a class
is that an ID
can be used to identify one element, whereas a class can be used to identify more than one.
Latest Version : CSS version 4 was released in March 2017.
Advantages
- Saves time
- Pages load quickly
- Easy to maintain
- Superior styles in HTML
- Compatible with multiple devices
Development History
CSS was proposed by Hakon Wium Lie in October 1994. The first released was made public in December 1996.