Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

CSS Interview Questions and Answers

Ques 11. \'Fixed\' Background?

Ans. There is the possibility to use the HTML tag bgproperties=\"fixed\", but that is IE proprietary, and dependent upon the \'background\' attribute (deprecated in HTML4).

With CSS, you can declare the background like:

BODY {
font-family : \"Trebuchet MS\", Verdana, Arial, Helvetica, sans-serif;
background-image: url(images/yourimage.gif);
background-repeat: no-repeat; /*no-tiling background*/
background-position: center;
background-attachment: fixed;
background-color: #hexcolor;
color : #hexcolor;
margin: 10px;
}

that shows a background-image in the center of the element, non-scrolling and non-repeating - in IE or NN6. NN 4.xx gets the non-repeat-part right, but stuffs the picture in the upper left corner and scrolls ...

Is it helpful? Add Comment View Comments
Ques 12. What is embedded style? How to link?
Ans. Embedded style is the style attached to one specific document. The style information is specified as a content of the STYLE element inside the HEAD element and will apply to the entire document.
Is it helpful? Add Comment View Comments
Ques 13. What is ID selector?
Ans. ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID attribute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements. ID selectors are created by a character # followed by the selector\'s name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit.

#abc123 {color: red; background: black}

This and only this element can be identified as abc123

Is it helpful? Add Comment View Comments
Ques 14. What is contextual selector?
Ans. Contextual selector is a selector that addresses specific occurrence of an element. It is a string of individual selectors separated by white space, a search pattern, where only the last element in the pattern is addressed providing it matches the specified context.

TD P CODE {color: red}

The element CODE will be displayed in red but only if it occurs in the context of the element P which must occur in the context of the element TD.

TD P CODE, H1 EM {color: red}

The element CODE will be displayed in red as described above AND the element EM will also be red but only if it occurs in the context of H1

P .footnote {color: red}

Any element with CLASS footnote will be red but only if it occurs in the context of P

P .footnote [lang]{color: red}

Any element with attribute LANG will be red but only if it is classed as \"footnote\" and occurs in the context of P
Is it helpful? Add Comment View Comments
Ques 15. How do I have a background image that isn\'t tiled?
Ans. Specify the background-repeat property as no-repeat. You can also use the background property as a shortcut for specifying multiple background-* properties at once. Here\'s an example:

BODY {background: #FFF url(watermark.jpg) no-repeat;}
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2016 WithoutBook