Which CSS property is used to change the background color of an element?
Correct answer:
B) background-color
Explanation: The background-color property is used to specify the background color of an HTML element.
Which CSS property is used to change the background color of an element?
Correct answer:
B) background-color
Explanation: The background-color property is used to specify the background color of an HTML element.
How do you display hyperlinks without an underline in CSS?
Correct answer:
A) a {text-decoration:none;}
Explanation: The text-decoration:none CSS rule removes the default underline from hyperlinks.
Which CSS property controls the text size of an element?
Correct answer:
A) font-size
Explanation: The font-size property controls the size of the text inside an HTML element.
Which CSS property is used to make text bold?
Correct answer:
B) font-weight:bold
Explanation: The font-weight property is used to make text bold in CSS.
How do you make each word in a text start with a capital letter in CSS?
Correct answer:
B) text-transform:capitalize
Explanation: The text-transform:capitalize property makes the first letter of each word uppercase.
Which CSS property changes the font of an element?
Correct answer:
A) font-family
Explanation: The font-family property specifies the font of an HTML element.
Which CSS property is used to change the left margin of an element?
Correct answer:
B) margin-left
Explanation: The margin-left property adjusts the left margin of an HTML element.
True or False: Negative values can be used when specifying padding in CSS.
Correct answer:
B) False
Explanation: Padding in CSS cannot have negative values, only positive values are allowed.
How do you select an element with the ID demo in CSS?
Correct answer:
B) #demo
Explanation: The #demo selector is used to target an element by its ID in CSS.
How do you select all elements with the class name test in CSS?
Correct answer:
C) .test
Explanation: The .test selector is used to target all elements with the class name test in CSS.
How do you group multiple selectors in CSS?
Correct answer:
C) Use a comma between selectors
Explanation: Grouping multiple selectors with a comma allows the same CSS rule to apply to all specified elements.
What is the default value of the CSS position property?
Correct answer:
D) static
Explanation: The default value of the position property is static, meaning elements are positioned according to the normal flow of the document.
Which HTML element is used to define strong importance text?
Correct answer:
A) <strong>
Explanation: The <strong> tag is used to define text that is of strong importance, often rendering in bold.
How do you add a comment in CSS?
Correct answer:
C) /* this is a comment */
Explanation: Comments in CSS are written inside /* ... */ and are ignored by the browser.
Which CSS property is used to change the text color of an element?
Correct answer:
A) color
Explanation: The color property is used to change the text color in CSS.
How do you set a background image in CSS?
Correct answer:
C) background-image:url('image.gif');
Explanation: The background-image property is used to set a background image for an element in CSS.
Which CSS property is used to set the width of an element's border?
Correct answer:
B) border-width
Explanation: The border-width property sets the thickness of the border around an element.
How do you add a shadow to text in CSS?
Correct answer:
A) text-shadow
Explanation: The text-shadow property adds shadow effects to text in CSS.
What is the CSS property that controls the horizontal alignment of a block element?
Correct answer:
B) text-align
Explanation: The text-align property is used to specify the horizontal alignment of inline content within a block-level element.
Which CSS property controls the visibility of an element?
Correct answer:
B) visibility
Explanation: The visibility property is used to control whether an element is visible or hidden on the page.
Which CSS property is used to set the space between an element's content and its border?
Correct answer:
B) padding
Explanation: The padding property controls the space between the content of an element and its border.
Which CSS property is used to create rounded corners on an element?
Correct answer:
A) border-radius
Explanation: The border-radius property allows you to add rounded corners to elements in CSS.
Which of the following is not a valid way to specify colors in CSS?
Correct answer:
D) color:red
Explanation: While red is a valid color keyword, color:red is not a valid way to specify colors in CSS; it should be color: red;.
Which CSS property specifies whether an element should float to the left or right?
Correct answer:
C) float
Explanation: The float property specifies whether an element should float to the left or right of its containing element.
Which CSS property is used to stop elements from floating?
Correct answer:
B) clear
Explanation: The clear property stops floating elements and forces the next element to appear on a new line.
Which CSS property is used to specify the display behavior of an element?
Correct answer:
B) display
Explanation: The display property determines how an element is displayed on the page, such as block, inline, or none.
Which CSS property controls the layout of flex items in a flex container?
Correct answer:
C) flex-direction
Explanation: The flex-direction property controls the direction in which flex items are laid out inside a flex container.
Which CSS property defines the gap between flex items?
Correct answer:
C) gap
Explanation: The gap property defines the space between rows and columns of items in a flex or grid container.
Which CSS property is used to adjust the stacking order of positioned elements?
Correct answer:
C) z-index
Explanation: The z-index property controls the stacking order of elements that overlap.
Which of the following is a valid pseudo-class in CSS?
Correct answer:
A) :hover
Explanation: The :hover pseudo-class is triggered when a user hovers over an element.
Which CSS property controls the speed of a CSS animation between keyframes?
Correct answer:
B) animation-timing-function
Explanation: The animation-timing-function property controls how an animation progresses between keyframes.
How do you create a CSS variable with global scope?
Correct answer:
B) Declare it in the :root selector
Explanation: CSS variables with global scope are declared inside the :root selector.
What is the correct syntax for defining a CSS variable called --main-color?
Correct answer:
A) --main-color: blue;
Explanation: CSS variables are defined with two dashes (--) followed by the variable name.
Which of the following is not a valid unit for specifying lengths in CSS?
Correct answer:
D) hm
Explanation: hm is not a valid unit in CSS; px, em, and cm are valid units for specifying lengths.
Which CSS layout mode provides an efficient way to lay out items in a container?
Correct answer:
B) flexbox
Explanation: Flexbox provides an efficient way to arrange items in a container that adjusts for different screen sizes.
Which CSS property determines whether flex items wrap onto multiple lines in a flex container?
Correct answer:
A) flex-wrap
Explanation: The flex-wrap property controls whether flex items are forced into one line or wrapped onto multiple lines.
Which CSS property specifies the number of columns in a grid container?
Correct answer:
B) grid-template-columns
Explanation: The grid-template-columns property defines the number and width of columns in a grid container.
Which CSS property is used to control where elements should appear in the browser?
Correct answer:
C) position
Explanation: The position property determines where elements are positioned in the browser window.
Which of the following is a valid CSS transition property?
Correct answer:
A) transition-property
Explanation: The transition-property specifies which properties should be animated during a transition.
Which CSS property is used to apply a transformation to an element, such as rotation or scaling?
Correct answer:
A) transform
Explanation: The transform property is used to rotate, scale, or move elements.
What CSS property allows you to rotate an element?
Correct answer:
B) transform
Explanation: The transform property can rotate an element using the rotate function.
Which CSS property applies a delay before an animation starts?
Correct answer:
B) animation-delay
Explanation: The animation-delay property specifies a delay before the animation begins.
Which CSS property defines the number of times an animation will run?
Correct answer:
C) animation-iteration-count
Explanation: The animation-iteration-count specifies how many times an animation should repeat.
Which CSS property is used to transition an element from one state to another when a property value changes?
Correct answer:
A) transition
Explanation: The transition property allows for smooth changes between states when a property value is modified.
Which CSS property is used to control a widget's appearance based on the operating system theme?
Correct answer:
A) appearance
Explanation: The appearance property modifies the appearance of UI widgets to match the operating system's style.
Which CSS preprocessor uses variables, arithmetic, and functions to enhance stylesheets?
Correct answer:
A) Sass
Explanation: Sass is a popular CSS preprocessor that allows the use of variables, functions, and other advanced features.
Which Sass feature allows you to define reusable styles in your stylesheets?
Correct answer:
B) @mixin
Explanation: Mixins in Sass allow you to create reusable styles that can be included in multiple selectors.
Which unit in CSS is relative to the width of the viewport?
Correct answer:
A) vw
Explanation: The vw unit represents 1% of the viewport width, making it responsive to the screen size.
Which property is used to define the amount of space between grid columns?
Correct answer:
C) column-gap
Explanation: The column-gap property defines the space between columns in a CSS grid.
Which CSS property is used to apply styles based on user behavior or element states, like hovering?
Correct answer:
C) :hover
Explanation: The :hover pseudo-class is used to apply styles when the user hovers over an element.
If this exam is giving you a hard time, let us be your helping hand. Contact us, and we'll provide the assistance you need to pass and move forward.