NEW
Font size
S
M
L
XL
WorksheetsW3Schools - CSS-A
Total questions: 63
Worksheet time: 33mins
Name
Class
Date
1.
Which HTML tag is used to define an internal style sheet?
a)
<css>
b)
<body>
c)
<style>
d)
<script>
2.
If you want to have more than one property for a CSS selector, what character separates them?
a)
comma (,)
b)
semi-colon (;)
c)
colon (:)
d)
dash (-)
3.
What does CSS stand for?
a)
Creative Style Sheets
b)
Cascading Style Sheets
c)
Colorful Style Spread
d)
Computer Style Spread
4.
Where in the HTML document is the correct location to insert code to link to your external CSS?
a)
In the <head> section
b)
In the <body> section
c)
At the very end of the document
d)
At the very beginning of the document
5.
Which is correct CSS syntax?
a)
{ body; color=black;}
b)
body: color= black
c)
body {color:black;}
d)
(body color is black)
6.
Select the code below that uses CSS to configure a background color of #000000 for a web page.
a)
body { background-color: #000000; }
b)
body { bgcolor: #000000; }
c)
document { background-page: #000000; }
d)
None of these
7.
Which is the value in this CSS?
p {color: red;}
p {color: red;}
a)
p
b)
color
c)
red
d)
{color:red}
8.
Which is the property in this CSS?
p {color: red;}
p {color: red;}
a)
p
b)
color
c)
red
d)
{color:red}
9.
A selector (ex: h1{ } ) can only have 1 property
a)
true
b)
false
10.
You should always define a backup font-family in CSS.
a)
True
b)
False
11.
If you want to have more than one declaration in a CSS rule, what character separates them?
a)
comma ,
b)
semi-colon ;
c)
colon :
d)
space
12.
Which is the selector in this CSS?
p {color: red;}
p {color: red;}
a)
p
b)
color
c)
red
d)
{color:red;}
13.
Which is the correct way to specify the color of a paragraph of text?
a)
p { color:#ff0000; }
b)
p { text-color:#ff0000; }
c)
p { font-color: #ff0000; }
d)
p {font:#ff0000;}
14.
What symbol should precede hexadecimal color codes?
a)
ampersand (&)
b)
semicolon (;)
c)
number sign (#)
d)
equal sign (=)
15.
You should just code your CSS styles within your HTML
a)
True
b)
False
16.
When a color is specified like this: #66cdaa what is it referred to as?
a)
Color name
b)
Hex code
c)
RGB value
d)
color code
17.
Use the ________ tags to code internal CSS styles in the head section of a web page.
a)
<link></link>
b)
<embed></embed>
c)
<style></style>
d)
None of these
18.
What CSS property is used to change the background color?
a)
color
b)
bgcolor
c)
bg-color
d)
background-color
19.
What code links your CSS to your HTML file?
a)
<link href="stylesheet.css"/>
b)
<link type="text/css" href="stylesheet.css"/>
c)
<link type="text/css" rel="stylesheet" href="stylesheet"/>
d)
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
20.
What is the order of precedence for CSS?
a)
External styles override embedded styles.
b)
External styles overrides all other styles.
c)
Internal styles override inline styles.
d)
Inline styles override all other styles.
21.
Pojan is creating a website using the HTML5 standard. He plans to use CSS but is unsure of which CSS standard HTML5 supports. Which CSS standards can he use?
a)
Any CSS standard (CSS1, CSS2, or CSS3)
b)
The CSS2 and CSS3 standards only
c)
The CSS3 standard only
d)
The CSS1 and CSS2 standards only
22.
Julie is redesigning the website for Kimber's Dance Studio. She plans to set her styles using RGB colors and wants to use pure blue. What color code will she use?
a)
0, 0, 255
b)
#00FFFF
c)
0, 255, 0
d)
#00FF00
23.
Which of the following is the correct CSS format to make the heading text red?
a)
<h1 style=”color:#ff0000;”>text</h1>
b)
<h1 color=”#ff0000;”>text</h1>
c)
<h1 font-color="red”>text</h1>
d)
None of the above
24.
Look at the diagram. Which letter corresponds to the margin?
a)
A
b)
B
c)
C
25.
Which HTML attribute is used to define inline styles?
a)
style
b)
styles
c)
class
d)
font
26.
How do you group selectors?
a)
Separate each selector with a space
b)
Separate each selector with a colon
c)
Separate each selector with a semi-colon
d)
Separate each selector with a comma
27.
To denote a class for "special" headings, you would do which of the following?
a)
.h1
b)
.special
c)
#special
d)
#h1
28.
Which of the following is correct about RGB Values format of CSS colors?
a)
This color value is specified using the rgb( ) property.
b)
This property takes three values, one each for red, green, and blue.
c)
The value can be an integer between 0 and 255 or a percentage.
d)
All of the above.
29.
Which of the following selectors match an element based on its id?
a)
The ID Selector
b)
The Universal Selector
c)
The Descendant Selector
d)
The Class Selector
30.
Which selector indicates this element?
<a id="top">Top</a>
<a id="top">Top</a>
a)
.top { }
b)
#top { }
c)
*top { }
d)
top { }
31.
How do you call a class in CSS?
a)
classname {}
b)
"classname" {}
c)
#classname {}
d)
.classname {}
32.
How do you call an ID in CSS?
a)
idname{}
b)
#idname{}
c)
"idname"{}
d)
.idname{}
33.
Where does CSS go?
a)
In the body
b)
In the <style></style> tags
c)
Above the <style></style> tags
d)
Below the </html>
34.
_______ is generally any single line of CSS that appears between the curly braces, whether shorthand or longhand.
a)
Keyword
b)
Declaration
c)
Value
d)
Boogers
35.
What tag is used for CSS?
a)
<style>
b)
<css>
c)
<body>
d)
<script>
36.
The three types of CSS we studied were:
a)
Online, Offline, Server
b)
Inline, Enclosed, Internal
c)
Online, Encased, Inherent
d)
Inline, Internal, External
37.
When using a “class” CSS selector, what is the correct form of “body?”
a)
body
b)
#body
c)
!body
d)
.body
38.
When using an “element” CSS selector, what is the correct form of “body?”
a)
.body
b)
body
c)
#body
d)
</body>
39.
When using an “id” CSS selector, what is the correct form of “body”?
a)
#body
b)
body
c)
.body
d)
{body}
40.
External CSS rules are contained in a text file ________ from the html document.
a)
Separate
b)
Same
c)
Remove
d)
Nothing goes in the blank above
41.
Where is the External CSS link element placed?
a)
In the <body>
b)
In the <head>
c)
In the <footer>
d)
In the <title>
42.
Which is the correct font family order?
a)
Comic sans, Cursive, Serif
b)
Arial, Verdana, Sans-serif
c)
Arial
d)
Sans-serif, verdana, arial
43.
If the page has a <div style='padding: 10px;'> what type of CSS is this?
a)
Inline
b)
Style Tag
c)
External Stylesheet
d)
User Stylesheet
44.
What is the latest Standard of CSS?
a)
CSS2
b)
CSS3
c)
CSS4
d)
CSS5
45.
The class selector uses which of the following symbols in front of the name?
a)
#
b)
.
c)
none
d)
*
46.
What is the difference between HTML & CSS?
a)
CSS is one type of HTML
b)
HTML gives a webpage structure, CSS provides styling
c)
CSS structures the webpage, HTML strictly provides styling
d)
There is no difference
47.
Which choice correctly describes two benefits of Cascading Style Sheets (CSS)?
a)
CSS allows you to apply one page's structure to another and to combine all formatting instructions into a single file.
b)
CSS provides a consistent look and feel to site pages, and simplifies change management issues.
c)
CSS provides a template for creating pages and simplifies coding for creating pages manually.
d)
CSS allows you to control browser choice and to apply one page's structure to another.
48.
In Cascading Style Sheets (CSS), what is a rule?
a)
A format instruction that consists of a specified selector and the properties and values applied to it
b)
A set of values that can be applied to a given property
c)
A set of values that can be specified for a given selector
d)
An HTML tag in a Web page that references the style sheet to be applied
49.
You see the following MIME type on a file attached to an e-mail: text/css. What file name extension is usually given to this MIME file type so that Web servers can properly process it?
a)
.html
b)
.doc
c)
.css
d)
.txt
50.
Consider the following code in a CSS document:
h1{font-family:arial, sans-serif; color:black; font-size:32 px;}
Why will this code not render properly in a Web browser?
h1{font-family:arial, sans-serif; color:black; font-size:32 px;}
Why will this code not render properly in a Web browser?
a)
Because the size of text must be specified in inches, not pixels.
b)
Because the font-size property of the h1 heading style cannnot be modified from its default value of 16 pixels.
c)
Because arial is a serif font
d)
Because there is a space between the number and the abbreviation in the font-size property.
51.
How is CSS applied to a web page?
a)
Inline styles
b)
Internal style sheets
c)
External style sheets
d)
All of these
52.
Each CSS rule that includes property & value is called a(n) ___________.
a)
declaration
b)
id
c)
class
d)
element
53.
What are the parts of CSS syntax?
a)
Doctype, head, body
b)
Curly braces, declaration, declaration block, selector & property/value
c)
Brackets (<>), element, definition
d)
Brackets (<>), declaration, property/value
54.
The code for the comment tag in CSS is
a)
<!-- comment -->
b)
<!-- comment >
c)
/* comment /*
d)
/* comment */
55.
If some properties have been defined for the same selector (element) in different style sheets, which value will be used?
a)
the value from the last read style sheet will be used.
b)
the value from the first read style sheet will be used.
c)
none of the values will be used because it isn't clear, so the default will be used
d)
the internal will always override everything else
56.
Which style has priority?
a)
external styles
b)
internal styles
c)
inline styles
d)
embedded styles
57.
Where can you use background-color?
a)
body
b)
h1
c)
p
d)
all of these
58.
When using a background image, what should you also always do?
a)
have a backup image
b)
have a backup color
c)
have an alt tag
d)
have a white background also
59.
What should you keep in mind when selecting a background image?
a)
Most people don't like background images
b)
How well your font can be read on the background image
c)
Background images don't look professional
d)
All of these
60.
By default, how does a background image appear on a web page?
a)
Tiled, repeating horizontally & vertically
b)
Covering the entire page
c)
The actual picture size in the center of the page
d)
Tiled, repeating vertically
61.
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
What does this code do?
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
What does this code do?
a)
Shows 1 tree on the right that doesn't scroll
b)
Shows 1 tree on the right that does scroll
c)
Shows trees going down the page on the right
d)
Shows a tree fixed to the center of the page
62.
How do you use a shorthand for CSS code?
a)
Use abbreviations for properties such as bg for background
b)
Put several values with one property
c)
Put several properties with one value
d)
You can't shorthand CSS
63.
When using both background-image and background-color, what will render on the page by default?
a)
a white background, because it isn't clear
b)
the background color
c)
the background image
d)
it depends on the browser
Reset
