CSS2 interview questions(61-70)

How do I have a non-tiling (non-repeating) background image?

With CSS, you can use the background-repeat property. The background repeat can be included in the shorthand background property, as in this example:

body {
background: white url(example.gif) no-repeat ;
color: black ;


CSS is clearly very useful for separating style from content. But apparently people tend to have problems when using it for layouts. Would you say this is because people have not yet understood how to properly do layout in CSS, or is it CSS that is lacking in this area? What can be done to improve the situation? — Would the web benefit from HTML and CSS being complemented with some kind of “layout language”?

Layout and style should be tackled by the same language and the two are intertwined. Trying to split the two is like splitting the HTML specification in two, one specification describing inline elements and the other describing block elements. It’s not worth the effort. CSS is capable of describing beautiful and scalable layouts. The CSS Zen Garden has been a eye-opening showcase of what is possible today. If MS IE had supported CSS tables, another set of layouts would have been possible. So, there is still lots of potential in the existing CSS specifications which should be the next milestone.

Styles not showing?

There are different ways to apply CSS to a HTML document with a stylesheet, and these different ways can be combined:

* inline (internal) (Deprecated for XHTML)
* embedded (internal)
* linked (external) and
* @import (external)

Note: An external stylesheet is a text file that contains only CSS Styles. HTML comments are not supposed to be in there and can lead to misinterpretation (> is the CSS “Child” selector!).

How do I quote font names in quoted values of the style attribute?

The attribute values can contain both single quotes and double quotes as long as they come in matching pairs. If two pair of quotes are required include single quotes in double ones or vice versa:

It’s been reported the latter method doesn’t work very well in some browsers, therefore the first one should be used.

Why is my external stylesheet not working ?

There may be several different reasons behind that, but one very common mistake is to have an external stylesheet that contains HTML markup in some form.

An external stylesheet must contain only CSS rules, and if required, correctly formed CSS comments; never include any HTML syntax, such as