CSS3 Interview Questions and Answers

TOP CSS3 Interview Questions & Answers

CSS3 Interview Questions

1. Explain about some of the features of CSS?
Some of the features used by CSS are to define a layout, colors, fonts, etc. It separates the content from the design part which makes the content much more visible thereby improving productivity of the entire process. It can make the same page appear in different formats.

2. State some limitations of style sheets?
Style sheets do have its own share of limitations some of them are as follows. – 1) Inconsistent browser support 2) Vertical control limitations 3) Margin collapsing, float containment, control of element shapes, etc 4) Lack of column declaration and variables are some of the limitations present in CSS.

3. What are cascading style sheets?
Cascading style sheets help the designer in various ways. It primarily helps to design style sheets for content and HTML pages. It can be applied to any XML document or mark up language.

4.Explain about absence of expressions?
CSS currently does not have the ability to specify property values as simple expressions. For example if you want to calculate the size of all the columns but you have a restriction on the sum of all columns. This problem has been solved by many browsers by proprietary expressions which did the job well.

5.Explain about CSS filter?
CSS filter solves designers and coders difficulties. With the help of these filters one can write entirely different code or modify the existing design patterns so that browsers receive CSS specifications which they support, thereby not allowing the browsers to make or create any unnecessary changes.

6.Explain about CSS1?
W3C recommended adoption of CSS1in 1996. Some of the capabilities and features present in CSS1 are as follows. 1) Font properties 2) Background colors, text colors, etc 3) Spacing between text, words, etc 4) Tables, images alignment 5) Border, margin, padding and positioning of elements 6) Attributes are uniquely identified and classified generically. W3C still adopts the specifications put forwarded in CSS1.

7.Explain about float containment?
CSS does not support float elements as it can cause overflow of the elements. Floats also tend to vary according to the web browser resolution and size but positions do not. There are some multiple properties which can define about float but they have their own limitations.

8.Explain about Internet explorer box model bug?
Designers had a very tough time dealing with this bug, because it will not display box widths appropriately on the webpage. It displayed the block to be narrow in size. This bug can be rectified by using CSS filter and hacks. Also correct usage and documentation of XHTML can solve the problems.

9.Explain about lack of orthogonality?
Lack of orthogonality explains about the various multiple jobs which are either undefined correctly for a specific application or used multiple times for the same job. CSS defines that internal elements of a table will not have margins so usage of border spacing is appropriate which leads to confusion.

10.Explain about the ease of maintenance with CSS
An effective style sheet has effective use of inheritance and cascading style sheets. When changes are applied to a single element of this global style sheet every element of the web page changes. This made the maintenance easy because here we can change the style of the whole page by effecting a change to a single element.

11.Explain about the hover element?
A hover element is activated when the user moves a pointer over the area where HTML coding is defined. This style is being extensively used for online advertising. It is appended to #elementid.hover.

12.Explain about the rules present in style sheets?
A huge list of rules is defined for style sheets. Each rule consists of selectors and declaration block. A declaration block consists of declarations which can be defined and separated by using a semicolon within curly braces. Also each declaration consists of a colon, a property and a semicolon.

13.Explain about vertical control limitation?
Vertical control limitations are always a nightmare for a designer. Horizontal positioning of text or element is always easy but vertically positioning an element always leads to convoluted and impossible tasks. CSS has unsupported rules for vertical placement of elements.

14.State some of the uses of CSS?
CSS offers many possibilities to a designer and developer. Some of them are 1) Moving of the entire style sheet coding to a separate external folder. 2) Repetition and code reuse features make CSS rich. 3) Presentation and structure are made different by CSS etc.

15.State the different type of author styles?
A web page author, developer, designer, etc can describe styles in three different forms they are 1) External style sheets 2) Embedded style 3) Inline styles 4) Local and default style sheet. A default style sheet consists of the style imparted by the browser which the user is accessing for the information.

16.What are the additional features which were present in CSS2 compared to CSS1?
Many of the new features were present in CSS2 some of them are as follows. 1) Positioning of elements will be according to the relative, fixed and the absolute positioning. 2) Inclusion of large number of media functions. 3) Shadows, bidirectional support for text and aural style sheets.

17.What are the main goals of applying style sheets?
The main use of style sheet is to give the user a greater degree of control over his presentation. If the user does not like a certain font he can change it with flexibility without any difficulty. Also a developer can minimize the effects which a browser can have on the application or the text part of the webpage. Control over the entire web page without any external influences, separation of the page from the HTML code part.

18. What is wrapping in CSS3?
Wrapping is a vital property for proper display of contents in web pages. If wrapping is disabled then the user could not display and view long lines that goes outside the window boundary and thus becomes useless.

19. What is the syntax of Opacity in CSS3?
Firefox uses the property opacity:x for transparency, while IE uses
filter:alpha (opacity=x).

20. How do you manage the complete site in center of the browser, which is completely using divs using the help of css2 or css3?
In CSS file
1. body{width:100%;}
2. Create a div tag and assign a class, say ‘container’ and place all your content in this div tag.
3. Assign properties to this class in CSS file
container{width:777px; margin:auto;}
Note: “margin:auto” will place your page in center of the page.

21. How is Multi-Column feature used in CSS3?
By using the Multi-Column feature of CSS3 the web designers can get their output in multiple columns with definitions defined for each column like column-width, column-count.

22. What is the syntax of Word Wrap in CSS3?
The general syntax word-wrap property of CSS3 is as follows:
word-wrap: normal| break-word
The default initial value is normal in the above syntax.

23. How is white-space Property of CSS3 used?
I think you are asking about the syntax for the usage of white-space Property of CSS3.
The general format of white-space Property of CSS3 is as follows:
white-space: nnormal | pre | nowrap | pre-wrap | pre-line
Let me know if you have any other query.

24. How flexibility is achieved more in CSS3?
Flexibility achieved is in greater ratio in CSS3 because of the feature of handling multiple style sheets in CSS3 and because of the modularized approach of CSS3.

25. What are the values that can be taken by property white-space of CSS3?
The five values that can be taken by property white-space of CSS3 are normal, pre, no wrap, pre-wrap and pre-line.

Frequently Asked CSS3 Interview Questions