CSS Quiz 2

Description: CSS Quiz 2
Number of Questions: 13
Created by:
Tags: css
Attempted 0/13 Correct 0 Score 0

What is the correct CSS syntax for making all the

elements bold?

css
  1. p {text-size:bold}

  2. p {font-weight:bold}

  3. style:bold

  4. p{font:bold}


Correct Option: B

How do you display hyperlinks without an underline?

css
  1. a {decoration:no underline}

  2. a {text-decoration:no underline}

  3. a {underline:none}

  4. a {text-decoration:none}


Correct Option: D
Explanation:

To display hyperlinks without an underline, you can use the CSS property "text-decoration" and set it to "none". This will remove the underline from the hyperlink text.

Option D is the correct answer:

The Answer is: D

How do you make each word in a text start with a capital letter?

css
  1. text-transform:uppercase

  2. text-transform:capitalize

  3. You can't do that with CSS


Correct Option: A

How do you change the font of an element?

css
  1. fon-face:

  2. font-family:

  3. f:

  4. font-style:


Correct Option: B

How do you make the text bold?

css
  1. font:b

  2. style:bold

  3. font-weight:bold


Correct Option: C

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?

css
  1. border-width:10px 20px 5px 1px

  2. border-width:10px 1px 5px 20px

  3. border-width:10px 5px 20px 1px

  4. border-width:5px 20px 10px 1px


Correct Option: B

How do you change the left margin of an element?

css
  1. padding:

  2. indent:

  3. margin:

  4. text-indent:

  5. margin-left:


Correct Option: E

To define the space between the element's border and content, you use the padding property, but are you allowed to use negative values?

css
  1. Yes

  2. No


Correct Option: B

How do you make a list that lists its items with squares?

css
  1. type: square

  2. list-style-type: square

  3. list-type: square

  4. style-list: square


Correct Option: B
Explanation:

To create a list that displays its items with squares, you need to use CSS. Specifically, you can use the list-style-type property to specify the style of the bullet point or marker for each item in the list.

Now, let's go through each option and explain why it is right or wrong:

A. type: square: This option is incorrect because the CSS property for specifying the list style is list-style-type, not type. Additionally, the value for a square marker is square, so the correct syntax would be list-style-type: square.

B. list-style-type: square: This option is correct. By using the list-style-type property and setting its value to square, you can create a list that displays its items with square markers.

C. list-type: square: This option is incorrect because there is no CSS property called list-type. The correct property to use is list-style-type.

D. style-list: square: This option is incorrect because there is no CSS property called style-list. The correct property to use is list-style-type.

The Answer is: B

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

css
  1. mainstyle.css


Correct Option: A
Explanation:

The correct HTML for referring to an external style sheet is:

A.

Explanation:

Option A is the correct answer. The `tag is used to link an external resource in HTML. In this case, it is used to link an external style sheet. Therelattribute specifies the relationship between the current document and the linked resource, and in this case, it is set to "stylesheet". Thetypeattribute specifies the MIME type of the linked resource, and in this case, it is set to "text/css", indicating that it is a CSS file. Thehref` attribute specifies the path to the external style sheet file, in this case, "mainstyle.css".

Option B is incorrect because the `` tag is used to define an embedded style sheet within the HTML document itself, not to link an external style sheet.

Option C is incorrect because there is no <stylesheet> tag in HTML. The correct tag to define a style sheet is <link>.

Option D is incorrect because the url attribute does not exist for the <link> tag. The correct attribute for specifying the URL of the linked resource is href.

Therefore, the correct answer is A. <link rel="stylesheet" type="text/css" href="mainstyle.css">

Which HTML tag is used to define an internal style sheet?

css

Correct Option: D

Which HTML attribute is used to define inline styles?

css
  1. styles

  2. class

  3. font

  4. style


Correct Option: D

What is the correct CSS syntax for making all the

elements bold?

css
  1. p {font-weight:bold}

  2. p {text-size:bold}


Correct Option: A
- Hide questions