Test 2 Flashcards
Which property is used to change the background color?
- color
- bgcolor
- background-color
background-color
How do you insert a comment in a CSS file?
’ this is a comment
/* this is a comment */
// this is a comment
// this is a comment //
/* this is a comment */
How do you select all p elements inside a div element?
- div.p
- div p
- div + p
div p
Which property is used to change the left margin of an element?
- padding-left
- margin-left
- indent
margin-left
Which CSS property is used to change the text color of an element?
text-color
fgcolor
color
color
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?
- border-width:10px 20px 5px 1px;
- border-width:5px 20px 10px 1px;
- border-width:10px 5px 20px 1px;
- border-width:10px 1px 5px 20px;
border-width:10px 1px 5px 20px;
Which CSS property controls the text size?
- font-size
- font-style
- text-size
- text-style
font-size
How do you display hyperlinks without an underline?
- a {text-decoration:none;}
- a {underline:none;}
- a {decoration:no-underline;}
- a {text-decoration:no-underline;}
a {text-decoration:none;}
How do you group selectors?
- Separate each selector with a comma
- Separate each selector with a plus sign
- Separate each selector with a space
Separate each selector with a comma
How do you select an element with id “demo”?
- demo
- *demo
- .demo
- # demo
demo
Which property is used to change the font of an element?
font-family
font
Both font-family and font can be used
Both font-family and font can be used
Which is the correct CSS syntax?
- {body:color=black;}
- {body;color:black;}
- body:color=black;
- body {color: black;}
body {color: black;}
How do you make the text bold?
- font:bold;
- style:bold;
- font-weight:bold;
font-weight:bold;
How do you select elements with class name “test”?
- test
- # test
- .test
- *test
.test
How do you add a background color for all
elements?
h1 {background-color:#FFFFFF;}
h1. all {background-color:#FFFFFF;}
all. h1 {background-color:#FFFFFF;}
h1 {background-color:#FFFFFF;}
Which HTML tag is used to define an internal style sheet?
- <style></style>
- <css></css>
<style></style>
What is the default value of the position property?
- static
- absolute
- relative
- fixed
static
Where in an HTML document is the correct place to refer to an external style sheet?
- In the section
- In the section
- At the end of the document
In the
section
What is the correct CSS syntax for making all the
elements bold?
p {text-size:bold;}
p {font-weight:bold;}
p {font-weight:bold;}
When using the padding property; are you allowed to use negative values?
- No
- Yes
No
How do you make each word in a text start with a capital letter?
- text-transform:uppercase
- You can’t do that with CSS
- text-transform:capitalize
text-transform:capitalize
How do you make a list that lists its items with squares?
- list-style-type: square;
- list: square;
- list-type: square;
list-style-type: square;
Which HTML attribute is used to define inline styles?
- class
- styles
- font
- style
style
What is the correct HTML for referring to an external style sheet?
- <style></style>
- <stylesheet>mystyle.css</stylesheet>
- <link></link>
<link></link>