Overview Flashcards
(144 cards)
What is the syntax for a class selector in CSS?
.my_class { property: value; }
Targets all elements with the class ‘my_class’.
What does the selector #my_id target?
A specific ID element
Targets an element with the ID ‘my_id’.
What does the X[title] selector do?
Targets elements with a specific title attribute
Useful for styling elements based on their attributes.
What is the purpose of the :hover pseudo-class?
Targets elements when the mouse hovers over them
Commonly used for interactive styles.
What does the :first-child selector target?
The first child of a parent element
Useful for applying styles to the first item in a list.
What does the ‘position’ property in CSS control?
The positioning method of an element
Possible values include relative, absolute, fixed, static, and sticky.
Fill in the blank: The ‘display’ property can take values such as _______.
none | block | inline | inline-block | flex
Determines how an element is displayed on the page.
What is the purpose of flexbox in CSS?
To control the layout of items in a container
Provides a more efficient way to layout, align, and distribute space among items.
What does the ‘z-index’ property control?
The stacking order of positioned elements
Higher values are in front of lower values.
What is the ‘background-color’ property used for?
To set the background color of an element
Accepts color values such as hex, rgb, or named colors.
What does the ‘border-collapse’ property determine?
Whether table borders are collapsed into a single border
Values include collapse or separate.
What does the ‘animation-name’ property specify?
The name of the animation to be applied
This name must match a defined keyframe animation.
Fill in the blank: The ‘font-weight’ property can take values such as _______.
normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
Controls the thickness of the text.
What is the function of the ‘transition-duration’ property?
Specifies how long a transition effect should take
Typically given in seconds or milliseconds.
What does the ‘opacity’ property control?
The transparency level of an element
Ranges from 0 (fully transparent) to 1 (fully opaque).
What is the purpose of the ‘text-align’ property?
To set the horizontal alignment of text within an element
Values include left, right, center, and justify.
What does the ‘overflow’ property manage?
How to handle content that overflows an element’s box
Values include visible, hidden, scroll, and auto.
Fill in the blank: The ‘list-style-type’ property can take values such as _______.
disc | circle | square | decimal | georgian
Defines the marker style for list items.
What does the ‘flex-direction’ property control?
The direction in which flex items are placed in the flex container
Values include row, row-reverse, column, and column-reverse.
What is the purpose of the ‘max-width’ property?
Sets the maximum width of an element
Prevents the element from growing beyond this width.
What does the ‘box-shadow’ property create?
A shadow effect around an element’s box
Can be customized with color, offset, blur, and spread values.
What is the ‘cursor’ property used for in CSS?
To specify the type of cursor to be displayed when pointing over an element
Values include pointer, text, move, and custom URLs.
What does the ‘column-count’ property control?
The number of columns an element should be divided into
Useful for multi-column layouts.
What is the function of the ‘transition-property’ in CSS?
Specifies which property should be transitioned
Can be set to all, or a specific property.