0% found this document useful (0 votes)
19 views8 pages

Chapter test-WPS Office

Web Design

Uploaded by

kathlynmaecolima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views8 pages

Chapter test-WPS Office

Web Design

Uploaded by

kathlynmaecolima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Which CSS property is used to change the text color of an element?

a) font-style

b) color

c) text-decoration

d) text-align

What does CSS stand for?

a) Computer Style Sheets

b) Colorful Style Sheets

c) Cascading Style Sheets

d) Creative Style Sheets

Which of the following selectors would select all paragraph elements inside a <div> with a class of
"container"?

a) div p.container

b) .container p

c) p.container

d) div.container p

What is the correct syntax for using an external style sheet?

a) <link src="style.css" rel="stylesheet">

b) <style src="style.css">

c) <link rel="stylesheet" href="style.css">

d) <stylesheet href="style.css">
Which of the following properties is used to control the space between elements?

a) padding

b) border

c) margin

d) spacing

How do you select an element with the ID "header" in CSS?

a) .header

b) #header

c) header

d) *header

Which property is used to change the background color of an element?

a) color

b) background-color

c) bgcolor

d) background-style

What does the padding property do in CSS?

a) Adds space inside the border of an element

b) Adds space outside the border of an element

c) Changes the color of the text

d) Sets the element's border width

Which CSS property is used to make text bold?


a) text-decoration

b) font-style

c) font-weight

d) text-transform

What value of the position property will keep an element in the same place even when the page is
scrolled?

a) static

b) relative

c) fixed

d) absolute

Which of the following units is NOT relative in CSS?

a) em

b) px

c) %

d) rem

In the shorthand margin: 10px 15px;, what does each value represent?

a) Top and right margins only

b) Top and bottom margins only

c) Top/bottom and left/right margins

d) Left and right margins only

How do you apply a font family that includes spaces (e.g., "Times New Roman")?
a) font-family: Times New Roman;

b) font-family: "Times New Roman";

c) font-family: 'Times New Roman';

d) Both b and c are correct

What is the default value of the position property for most HTML elements?

a) relative

b) fixed

c) absolute

d) static

Which CSS property would you use to make an element's text all uppercase?

a) text-transform

b) text-decoration

c) font-variant

d) font-style

How can you add 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

Which value for the display property hides an element but leaves space for it on the page?

a) none
b) hidden

c) inline

d) visibility

What is the correct CSS syntax to make all elements with a class of "menu" hidden?

a) .menu { visibility: none; }

b) .menu { display: none; }

c) #menu { display: hidden; }

d) menu { visibility: hidden; }

Which CSS property would you use to control the size of a flex container's children?

a) display

b) flex-grow

c) overflow

d) align-items

How do you select all <a> elements within a <div> with the class "navbar"?

a) div a.navbar

b) div > a.navbar

c) .navbar a

d) .navbar > a

What is the purpose of the @import rule in CSS?

a) To import an image

b) To import another CSS file


c) To import external HTML content

d) To import JavaScript files

These questions cover a range of CSS concepts, including basic properties, layout techniques, selectors,
and CSS syntax rules. Let me know if you'd like more specific topics or types of questions!

You said:

Answers key

ChatGPT said:

ChatGPT

Here's the answer key for the additional multiple-choice CSS questions:

b) background-color

The background-color property changes the background color of an element.

a) Adds space inside the border of an element

The padding property adds space inside the border, around the content.

c) font-weight

font-weight is used to make text bold.

c) fixed
position: fixed; keeps an element in place even when scrolling.

b) px

px is an absolute unit; em, %, and rem are relative units.

c) Top/bottom and left/right margins

margin: 10px 15px; sets the top and bottom margins to 10px, and the left and right margins to 15px.

d) Both b and c are correct

Both double and single quotes can be used around font-family names with spaces.

d) static

The default value of position is static.

a) text-transform

text-transform: uppercase; makes text uppercase.

b) / This is a comment /

Comments in CSS use /* comment */ syntax.

d) visibility

visibility: hidden; hides an element but leaves space for it.

b) .menu { display: none; }


display: none; hides an element completely, with no space left on the page.

b) flex-grow

flex-grow controls the size of a flex container's children.

c) .navbar a

This selector targets all <a> elements inside a .navbar class.

b) To import another CSS file

@import is used to import another CSS file into the current one.

These answers correspond to CSS syntax, rules, and behavior for various properties and concepts. Let
me know if you need further clarification on any of the answers!

You might also like