CSS Important Questions
1. What does CSS stand for?
a) Cascading Style
Sheets
b) Creative Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets
2. What is the correct HTML for referring to an external style sheet?
a) <link
rel="stylesheet" type="text/css"
href="mystyle.css">
b) <stylesheet>mystyle.css</stylesheet>
c) <style
src="mystyle.css">
d) note define
3. Where in an HTML document is the correct place
to refer to an external style sheet?
a) In the <head>
section
b) In the <body>
section
c) At the end of the
document
d) In the <haed> section
4. Which HTML tag is used to define an internal
style sheet?
a) <style>
b) <script>
c) <css>
d) a) <styles>
5. Which HTML attribute is used to define inline
styles?
a) style
b) class
c) styles
d) font
6. Which is the correct CSS syntax?
a) body {color:
black;}
b) {body;color:black;}
c) body:color=black;
d) {body:color=black;}
7. How do you insert a comment in a CSS file?
a) /* this is a comment
*/
b) // this is a comment //
c) // this is a comment
d) ' this is a comment
8. Which property is used to change the background
color?
a) background-color
b) color
c) bgcolor
d) background-collor
9. How do you add a background color for all
<h1> elements?
a) h1
{background-color:#FFFFFF;}
b) all.h1 {background-color:#FFFFFF;}
c) h1.all
{background-color:#FFFFFF;}
d) allh1 {background-color:#FFFFFF;}
10. Which CSS property is used to change the text
color of an element?
a) color
b) text-color
c) fgcolor
d) colour
11. Which CSS property controls the text size?
a) font-size
b) text-style
c) font-style
d) text-size
12. What is the correct CSS syntax for making all
the <p> elements bold?
a) p
{font-weight:bold;}
b) <p
style="text-size:bold;">
c) p {text-size:bold;}
d) <p
style="font-size:bold;">
13. How do you display hyperlinks without an
underline?
a) a
{text-decoration:none;}
b) a {decoration:no-underline;}
c) a
{text-decoration:no-underline;}
d) a {underline:none;}
14. How do you make each word in a text start with a
capital letter?
a) transform:capitalize
b) text-transform:capitalize
c) text-style:capitalize
d) You can't do that with
CSS
15. Which property is used to change the font of an
element?
a) font-family
b) font-style
c) font-weight
d) font- wait
16. How do you make the text bold?
a) font-weight:bold;
b) style:bold;
c) font:bold;
d) font:B;
17. How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?
a) border-width:10px 1px
5px 20px;
b) border-width:10px 5px
20px 1px;
c) border-width:5px 20px
10px 1px;
d) border-width:10px 20px
5px 1px;
18. Which property is used to change the left margin
of an element?
a) margin-left
b) padding-left
c) indent
d) leftmargin
19. When using the padding property; are you allowed
to use negative values?
a) No
b) Yes
20. How do you make a list that lists its items with
squares?
a) list-style-type:
square;
b) list-type: square;
c) ist: square;
d) list-type: none;
21. How do you select an element with id 'demo'?
a) #demo
b) *demo
c) .demo
d) demo
22. How do you select elements with class name
'test'?
a) .test
b) *test
c) #test
d) test
23. How do you select all p elements inside a div
element?
a) div p
b) div + p
c) div.p
d) none of these
24. How do you group selectors?
a) Separate each selector
with a comma
b) Separate each selector
with a space
c) Separate each selector
with a plus sign
d) none
25. What is the default value of the position
property?
a) static
b) relative
c) absolute
d) fixed
Post a Comment