
Q 1. What will be the output of below mentioned code snippet? h1 {color: “green”;}
A. heading becomes green
B. heading becomes dark-green
C. error occors
D. nothings happen
Show Answer
Answer:-D. nothings happenExplanation
Output of above code snippet won’t happen as the declaration syntax is wrong. The correct declaration is : h1 { color: green; } which will yeild an output. In CSS, we don’t write value in double quotes.Q 2 . Which of the following is the correct way to applying style to a document?
A. Use an external style sheet, either by importing it or by linking to it
B. Directly embed a document-wide style in the head element of the document
C. Set an inline style rule using the style attribute directly on an element
D. All of the mentioned
Show Answer
Answer:-D. All of the mentionedExplanation
We can style the document using CSS in three different ways i.e embed, inline and external. In any way as mentioned, we can apply CSS. An inline CSS means applying styles rules directly to the element. In embed, we declare or write all the needed style in tag in the head element of the document. Expect these two ways we can also use another way in which we can create an external style sheet and provide its link to the document.Q 3. With, which tag you write the style rules directly within the document found
within the head of the document.
A. <script>
B. <php>
C. <style>
D. <css>
Show Answer
Answer:-C. tag we write the style rules directly within the document in the head section of the document. tag is used to add javascript in the document.Q 4. What does screen media type is used for?
A. For use with all devices
B. For use with handheld devices
C. For use with computer screens
D. For use with television-type devices
Show Answer
Answer:-C. For use with computer screensExplanation
In CSS, media types are used for the compatibility of devices. There are four types of nedia types i.e all, print, screen and speech. Out of which screen media type is used for computer screens, tablets, smart-phones, etc.Q 5. For Inline Style, we don’t need to reapply style information throughout the document and outside documents.
A. True
B. False
Show Answer
Answer:-B. FalseExplanation
In inline style, properties are confined with a particular element to which it is applied. It won’t be applied to other element of the same type. We need to reapply style information throughout the document whenever it is necessary.Q 6. Inline style has the lowest priority
A. True
B. False
Show Answer
Answer:-B. FalseExplanation
Among inline, embed and external style ways, inline has the highest priority and it overrides the other.Q 7. For External Style Sheets in some cases when @import is used, the browser may cause a rendering “flash” under slow loading conditions.
A. True
B. False
Show Answer
Answer:-A. TrueExplanation
External Style Sheets in some cases when @import is used the browser may cause a rendering “flash” under slow loading conditions.Q 8. ___________ describes CSS properties to manipulate the position of “ruby”, which are small annotations on top of or next to words, especially common in Chinese and Japanese.
A. align
B. ruby
C. lang
D. text-align
Show Answer
Answer:-B. rubyExplanation
Align is used to align the content either left, right or center. Ruby describes CSS properties to manipulate the position of “ruby”, which are small annotations on top of or next to words, especially common in Chinese and Japanese. They are often used to give the pronunciation or meaning of difficult ideograms. Text-align is for aligning the text either left, right or in center.Q 9. ___________ has a grammar but unlike traditional (X)HTML it is not defined with a document type definition.
A. CSS 1
B. CSS 2
C. CSS 2.1
D. CSS 3
Show Answer
Answer:-C. CSS 2.1Explanation
CSS 2.1 has a grammar (www.w3.org/TR/CSS21/grammar.html) but unlike traditional (X)HTML it is not defined with a document type definition. Instead the CSS specification is a combination of prose and a grammar that could be used to build a simple parser.Q 10. What will be the output of following code snippet?
h1
{
color:
red text-decoration:
underline; font-style:
italic;
}
A. color: red, text-decoration: underline and font-style: italic all works
B. text-decoration: underline and font-style: italic works
C. color: red, text-decoration: underline works
D. only font-style: italic works
Leave a Reply