CSS Interview Questions and Answers
Question: 'Fixed' Background?Answer: 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?
Yes
No
Most helpful rated by users:
- What is CSS?
- What are Cascading Style Sheets?
- As a reader, how can I make my browser recognize my own style sheet?
- How do I combine multiple sheets into one?
- What are Style Sheets?