CSS Interview Questions and Answers
Here you can find CSS Interview Questions and Answers.
Why CSS Interview Questions and Answers Required?
In this CSS Interview Questions and Answers section you can learn and practice CSS Interview Questions and Answers to improve your skills in order to face technical
inerview by IT companies. By Practicing these interview questions, you can easily crack any CSS interview.
Where can I get CSS Interview Questions and Answers?
AllIndiaExams provides you lots CSS Interview Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students,
freshers can download CSS Interview Questions and Answers as PDF files and eBooks.
How to solve these CSS Interview Questions and Answers?
You no need to worry, we have given lots of CSS Interview Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the CSS
technical interview.
CSS Interview Questions and Answers
What is CSS ?
1. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. Every element type as well as every occurrence of
a specific element within that type can be declared an unique style, e.g. margins, positioning, color or size.
2. CSS is a web standard that describes style for XML/HTML documents.
3. CSS is a language that adds style (colors, images, borders, margins…) to your site. It’s really that simple. CSS is not used to put any content on your site, it’s just there to take
the content you have and make it pretty. First thing you do is link a CSS-file to your HTML document.
CSS Interview Questions and Answers
Is CSS case sensitive?
Cascading Style Sheets (CSS) is not case sensitive.
However, font families, URLs to images, and other direct references with the style sheet may be.
The trick is that if you write a document using an XML declaration and an XHTML doctype, then the CSS class names will be case sensitive for some browsers.
CSS Interview Questions and Answers
What is a class? What is an ID?
A class is a style (i.e., a group of CSS attributes) that can be applied to one or more HTML elements.
This means it can apply to instances of the same element or instances of different elements to which the same style can be attached.
Classes are defined in CSS using a period followed by the class name.
It is applied to an HTML element via the class attribute and the class name.
The following snippet shows a class defined, and then it being applied to an HTML DIV element.
.test {font-family: Helvetica; font-size: 20; background: black;}
test
Also, you could define a style for all elements with a defined class. This is demonstrated with the following code that selects all P elements with the column class specified.
p.column {font-color: black;}
An ID selector is a name assigned to a specific style.
In turn, it can be associated with one HTML element with the assigned ID.
Within CSS, ID selectors are defined with the # character followed by the selector name.
The following snippet shows the CSS example1 defined followed by the use of an HTML element’s ID attribute, which pairs it with the CSS selector.
#example1: {background: blue;}
CSS Interview Questions and Answers
What are properties of style sheet ?
CSS Background
CSS Text
CSS Font
CSS Border
CSS Outline
CSS Margin
CSS Padding
CSS List
CSS Table
CSS Interview Questions and Answers
What are the limitations of CSS ?
Limitations are:
• Ascending by selectors is not possible
•Limitations of vertical control
•No expressions
•No column declaration
•Pseudo-class not controlled by dynamic behavior
•Rules, styles, targeting specific text not possible
CSS Interview Questions and Answers
What are the advantages of CSS ?
Advantages are:
•Bandwidth
•Site-wide consistency
•Page reformatting
•Accessibility
•Content separated from presentation
CSS Interview Questions and Answers
List the various font attributes used in style sheet
font-style
font-variant
font-weight
font-size/line-height
font-family
caption, icon, menu, message-box, small-caption, status-bar.
CSS Interview Questions and Answers
What is the difference between an ID selector and CLASS?
An ID selector identifies and sets style to only one occurrence of an element, while CLASS can be attached to any number of elements.
CSS Interview Questions and Answers
What is Contextual Selector?
Contextual selector addresses specific occurrence of an element.
It is a string of individual selectors separated by white space (search pattern), where only the last element in the pattern is addressed providing it matches the specified contex
CSS Interview Questions and Answers
What is Grouping?
When more than one selector shares the same declaration, they may be grouped together via a comma-separated list; this allows you to reduce the size of the CSS (every bit
and byte is important) and makes it more readable. The following snippet applies the same background to the first three heading elements.