|
INTERVIEW QUESTIONS
WEB
CSS
DETAILS
Question: How does a simple CSS style rule look ?
Answer: P { font-family: serif; font-size: 1.2em; } Here we see a rule with a 'selector' P that has been given two style declarations, i.e. two 'property:value' pairs. 'font-family' and 'font-size' are properties of the content of element P , and these properties are assigned the values of 'serif' and '1.2em' respectively. A colon ':' is the value assignment symbol in CSS, so using an equal sign '=' instead is an error and is required by the CSS specification to be ignored. Any browser that appears to honor this style is behaving improperly. For length values a 'unit' is always needed and there shall never be any space between a number and its length unit. A value given as e.g. '1.2 em' is an error and is required by the CSS specification to be ignored. Any browser that appears to honor this style is behaving improperly. A semicolon ';' between declarations is required but it's also good "rule of thumb" to put a ';' even after the last declaration. Finally, curly braces '{…}' group one or more declarations into a final CSS rule.
|
|
|
Category |
CSS Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8922 users |
Added on |
9/4/2014 |
Views |
68860 |
Rate it! |
|
|
Question:
How does a simple CSS style rule look ?
Answer:
P { font-family: serif; font-size: 1.2em; } Here we see a rule with a 'selector' P that has been given two style declarations, i.e. two 'property:value' pairs. 'font-family' and 'font-size' are properties of the content of element P , and these properties are assigned the values of 'serif' and '1.2em' respectively. A colon ':' is the value assignment symbol in CSS, so using an equal sign '=' instead is an error and is required by the CSS specification to be ignored. Any browser that appears to honor this style is behaving improperly. For length values a 'unit' is always needed and there shall never be any space between a number and its length unit. A value given as e.g. '1.2 em' is an error and is required by the CSS specification to be ignored. Any browser that appears to honor this style is behaving improperly. A semicolon ';' between declarations is required but it's also good "rule of thumb" to put a ';' even after the last declaration. Finally, curly braces '{…}' group one or more declarations into a final CSS rule. 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 |
|
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
|
|
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
|
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
|