NEW
Font size
WorksheetsCSS Fundamentals
Total questions: 14
Worksheet time: 7mins
What is the purpose of CSS selectors?
CSS selectors are meant for organizing server-side scripts.
CSS selectors are used to create HTML elements.
The purpose of CSS selectors is to define JavaScript functions.
The purpose of CSS selectors is to select HTML elements for styling.
Which of the following is a type of CSS selector: class, ID, or both?
element
both
attribute
style
What property is used to change the text color in CSS?
text-color
font-color
background-color
color
What is the difference between inline and internal CSS?
Inline CSS affects a single element, while internal CSS affects multiple elements in the document.
Inline CSS is defined in a separate file, while internal CSS is written within the HTML tags.
Inline CSS applies to all elements, while internal CSS targets only one element.
Inline CSS is used for external styles, while internal CSS is for inline styles.
Which CSS property controls the layout of a flex container?
display
align-items
flex-wrap
flex-direction
How do you represent the color red in hexadecimal format?
#0000FF
#00FF00
#FFFF00
#FF0000
What does the 'flex-direction' property do in a flex container?
It aligns flex items to the center of the container.
It specifies the spacing between flex items in a container.
It determines the size of flex items in a flex container.
It sets the direction of flex items in a flex container.
Which CSS property is used to set the background color of an element?
background-color
background-style
color-background
element-color
What is the syntax for a class selector in CSS?
.classname
classname:
classname()
#classname
How can you center a flex item horizontally within a flex container?
Use 'justify-content: center' on the flex container.
Set 'align-items: center' on the flex container.
Use 'margin: auto' on the flex item.
Apply 'flex-direction: column' to the flex container.
What is the purpose of the 'display' property in CSS?
To specify the font style of elements in CSS.
To control the layout and rendering of elements on a web page.
To set the size of images displayed on a page.
To define the color of text on a web page.
What is the function of the 'margin' property in CSS?
To specify the border style of elements.
To control the visibility of elements.
To define the font size of text.
To set the space around elements.
How do you apply a style to all paragraphs in a document using CSS?
paragraph { }
all p { }
p: { }
p { }
What is the purpose of the 'padding' property in CSS?
To set the space inside an element, between the element's content and its border.
To define the space outside an element, between the element and its surrounding elements.
To control the size of the element's border.
To specify the font style of the text within an element.
