|
INTERVIEW QUESTIONS
WEB
CSS
DETAILS
Question: If one were to set Text and Link colors using a style sheet, should one also define the background colors for these elements as well?
Answer: It is generally true that you should give background or background-color a value, but not necessarily a color value. E.g., if the document has a background image, you would "highlight" all links if you give them a background color.
body { background-image: url(light-texture.png) #FFF; color: #000 } a:link, a:visited, a:active { color: #00F; background-color: transparent; }
By setting the background-image explicitly to transparent, you lower the risk of another rule in the cascade giving links a background that would highlight them.
|
|
|
Category |
CSS Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7491 users |
Added on |
9/4/2014 |
Views |
71851 |
Rate it! |
|
|
Question:
If one were to set Text and Link colors using a style sheet, should one also define the background colors for these elements as well?
Answer:
It is generally true that you should give background or background-color a value, but not necessarily a color value. E.g., if the document has a background image, you would "highlight" all links if you give them a background color.
body { background-image: url(light-texture.png) #FFF; color: #000 } a:link, a:visited, a:active { color: #00F; background-color: transparent; }
By setting the background-image explicitly to transparent, you lower the risk of another rule in the cascade giving links a background that would highlight them. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Why are there gaps above and below my form in IE?
|
View Answer
|
|
How does a simple CSS style rule look ?
|
View Answer
|
|
How does a simple CSS style rule look ?
|
View Answer
|
|
How do I move the list bullet to the left/right?
|
View Answer
|
|
I want my page fonts to look the same everywhere as in… a) Why are my font sizes different in different browsers ? b) Why are my font sizes different on different platforms ?
|
View Answer
|
|
Can you use someone else's Style Sheet without permission?
|
View Answer
|
|
How do I place two paragraphs next to each other?
|
View Answer
|
|
I made a 10px-high div, but IE makes it 20px high...
|
View Answer
|
|
To what are partial URLs relative?
|
View Answer
|
|
Do URL's have quotes or not?
|
View Answer
|
|
Why can @import be at the top only?
|
View Answer
|
|
Justified Text?
|
View Answer
|
|
Do any WYSIWYG editors support the creation of Style Sheets? Any text-based HTML editors?
|
View Answer
|
|
Must I quote property values?
|
View Answer
|
|
How do I centre my page?
|
View Answer
|
|
What is the percentage value in 'font-size' relative to?
|
View Answer
|
|
Can I attach more than one declaration to a selector?
|
View Answer
|
|
How To Style Forms?
|
View Answer
|
|
How To Style Table Cells?
|
View Answer
|
|
How far can CSS be taken beyond the web page--that is, have generalized or non-web specific features for such things as page formatting or type setting?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All CSS Interview Questions & Answers - Exam Mode /
Learning Mode
|