|
INTERVIEW QUESTIONS
WEB
CSS
DETAILS
Question: Why can @import be at the top only?
Answer: A style sheet that is imported into another one has a lower ranking in the cascading order: the importing style sheet overrides the imported one. Programmers may recognize this as the same model as in Java, Modula, Object-Pascal, Oberon and other modular programming languages. However, there is a competing model, well-known to C programmers, where the imported material is not lower in rank, but is expanded in-place and becomes an integral part of the importing document. By allowing @import only at the top of the style sheet, people that think in terms of the second model (although in principle incorrect) will still get the expected results: as long as the @import is before any other overriding rules, the two models are equivalent. Btw. In all the modular languages import statements are only allowed at the top. In C, the #include can be put elsewhere, but in practice everybody always puts it at the top. So there may not be that much need to allow @import elsewhere in the style sheet either.
|
|
|
Category |
CSS Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8920 users |
Added on |
9/4/2014 |
Views |
67783 |
Rate it! |
|
|
Question:
Why can @import be at the top only?
Answer:
A style sheet that is imported into another one has a lower ranking in the cascading order: the importing style sheet overrides the imported one. Programmers may recognize this as the same model as in Java, Modula, Object-Pascal, Oberon and other modular programming languages. However, there is a competing model, well-known to C programmers, where the imported material is not lower in rank, but is expanded in-place and becomes an integral part of the importing document. By allowing @import only at the top of the style sheet, people that think in terms of the second model (although in principle incorrect) will still get the expected results: as long as the @import is before any other overriding rules, the two models are equivalent. Btw. In all the modular languages import statements are only allowed at the top. In C, the #include can be put elsewhere, but in practice everybody always puts it at the top. So there may not be that much need to allow @import elsewhere in the style sheet either. 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 |
|
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
|
|
How frustrating is it to write a specification knowing that you're at the browser vendors' mercy?
|
View Answer
|
|
What is initial value?
|
View Answer
|
|
What is value?
|
View Answer
|
|
What is shorthand property?
|
View Answer
|
|
Why shouldn't I use fixed sized fonts ?
|
View Answer
|
|
What browsers support style sheets? To what extent?
|
View Answer
|
|
Which characters can CSS-names contain?
|
View Answer
|
|
How to make text-links without underline?
|
View Answer
|
|
What is the difference between ID and CLASS?
|
View Answer
|
|
Can I include comments in my Style Sheet?
|
View Answer
|
|
Is there anything that CAN'T be replaced by Style Sheets?
|
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
|