CSS for Web Development

0% completed

Previous
Next
Quiz
Question 1
Which of the following is the correct syntax for calculating the width of an element that subtracts 50 pixels from 100%?
A
width: calc(100% - 50px);
B
width: calc(100% -50px);
C
width: calc(100%-50px);
D
width: calc((100% - 50px));
Question 2
Which statement correctly describes the env() function?
A
It automatically adjusts font sizes based on user preferences.
B
It is used to execute JavaScript functions within CSS.
C
It outputs the current viewport dimensions.
D
It retrieves system environment variables to adjust CSS values, such as safe area insets on devices with notches.
Question 3
Which syntax correctly defines a CSS variable for the primary color?
A
body { $primary-color: #3498db; }
B
:root { --primary-color: #3498db; }
C
:root { var(--primary-color) = #3498db; }
D
.primary { primary-color: #3498db; }
Question 4
How does the following CSS rule calculate the width of an element?
.container {
  width: calc(100% - var(--sidebar-width, 200px));
}
A
It multiplies 100% by the value of --sidebar-width.
B
It sets the container width to 100% of 200px.
C
It sets the width of the container to 100% of its parent minus the value of --sidebar-width, or 200px if --sidebar-width is not set.
D
It will only work if --sidebar-width is defined.

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next