Skip to content

Latest commit

 

History

History
235 lines (172 loc) · 4.46 KB

Advanced_Selectors-Quiz.md

File metadata and controls

235 lines (172 loc) · 4.46 KB

Advanced Selectors Quiz

Question 1

Assume that this code is linked together correctly.

p{
  color: red;
  padding:10px 5px;
  background: black;
}
.fancy{
  font-family: cursive;
  background: red;
  color: green;
}
.plain{
  font-family: Times, serif;
  color: black;
}  

<p>Hi</p>

What color font is used to display "Hi"?

1) red
2) green
3) black
4) browser default

ANS: 1) red


Question 2

Assume that this code is linked together correctly.

p{
  color: red;
  padding:10px 5px;
  background: black;
}
.fancy{
  font-family: cursive;
  background: red;
  color: green;
}
.plain{
  font-family: Times, serif;
  color: black;
}  

<p class = "plain fancy">Hi</p>

What color font is used to display "Hi"?

1) red
2) green
3) black
4) browser default

ANS: 3) black


Question 3

Assume that this code is linked together correctly.

p{
  color: red;
  padding:10px 5px;
  background: black;
}
.fancy{
  font-family: cursive;
  background: red;
  color: green;
}
.plain{
  font-family: Times, serif;
  color: black;
}  

<p class = "fancy plain">Hi</p>

What color font is used to display "Hi"?

1) red
2) green
3) black
4) browser default

ANS: 3) black


Question 4

What is the correct HTML for referring to an external style sheet?

1) <link rel="stylesheet" url="mystyle.css">
2) <style src="mystyle.css"></style>
3) <link rel="stylesheet" href="mystyle.css">
4) <link rel="stylesheet" src="mystyle.css">

ANS:

3) <link rel="stylesheet" href="mystyle.css">

Question 5

What is the correct HTML for referring to an external style sheet stored in a subfolder called css?

 1) <link rel="css/stylesheet" href="css/mystyle.css"> 
 2) <style src="css/mystyle.css">
 30 <link rel="stylesheet" href="css/mystyle.css"> 
 4) <link rel="css/stylesheet" href="mystyle.css">

ANS: 3) <link rel="stylesheet" href="css/mystyle.css">


Question 6

The style tag and the style attribute are interchangeable -- this means that you accomplish the same effect with both.

1) True
2) False

ANS: 1) False


Question 7

Which CSS property controls the text size?

1) font-size
2) text-size
3) text-style
4) font-height

ANS: 1) font-size


Question 8

How do you display hyperlinks without an underline?

1) a {text-decoration:no-underline;} 
2) a { text-decoration:none; } 
3) a {decoration:no-underline;} 
4) a {underline:none;} 

ANS: 2) a { text-decoration:none; }


Question 9

In the following code snippet, what value is given for the left margin?

margin: 5px 10px 3px 8px;

1) 5px
2) 10px
3) 3px
4) 8px

ANS: 4) 8px


Question 10

The # symbol specifies that the selector is a/an

1) class
2) tag
3) first
4) id

ANS: 4) id


Question 11

Which of the following would be used to create class called button which has a width of 750px, a height of 30px and the color of the text is black?

1) #button { height: 30px; width: 750px; text: black; } 
2) .button { height: 30px; width: 750px; color: black; } 
3) #button { height: 30px; width: 750px; color: black; } 
4) .button { height: 30px; width: 750px; text: black; } 

ANS: 2) .button { height: 30px; width: 750px; color: black; }


Question 12

Which snippet of CSS is commonly used to center an element horizontally?

1) margin: 0 auto; 
2) margin: auto 0; 
3) site-align: center; 
4) margin: center; 

ANS: 1) margin: 0 auto;


Question 13

Using only a default style sheet..

1) will typically make your page look better.
2) will typically make your page look worse.
3) will typically have no effect on the appearance of your page.

ANS: 2) will typically make your page look worse.


Question 14

Which of the following is not a browser prefix?

1) o
2) webkit
3) edge
4) moz

ANS: 3) edge


Question 15

Descendant selectors

nav a{
  ....
}

are more general than child selectors

nav>a{
  ....
}


1) True
2) False

ANS: 1) True


Question 16

How much width will this div occupy?

div{
   width:100px;
   padding: 10px;
   margin: 5px;
   border: 2px;
}

ANS: 134px