Podcast
Questions and Answers
What property is used to remove double borders from a table?
What property is used to remove double borders from a table?
- border-style
- border-collapse (correct)
- border-spacing
- border-radius
The 'nth-child' selector can be used to create zebra-striped tables.
The 'nth-child' selector can be used to create zebra-striped tables.
True (A)
What is the purpose of the aria-label attribute in forms?
What is the purpose of the aria-label attribute in forms?
To provide an invisible label for screen readers.
The CSS property used to define the background color for even table rows is _____.
The CSS property used to define the background color for even table rows is _____.
Match the following CSS properties with their functions:
Match the following CSS properties with their functions:
What styling does the following CSS apply when the input field is focused? 'input[type=text]:focus { border: 2px solid #999; }'
What styling does the following CSS apply when the input field is focused? 'input[type=text]:focus { border: 2px solid #999; }'
CSS can be used to style form inputs to enhance their appearance and usability.
CSS can be used to style form inputs to enhance their appearance and usability.
What is the recommended font family used in the body style in the provided CSS?
What is the recommended font family used in the body style in the provided CSS?
What is the default value of the position property for elements in normal flow?
What is the default value of the position property for elements in normal flow?
Relative positioning removes an element from the normal flow of the document.
Relative positioning removes an element from the normal flow of the document.
What CSS property is used to make an element float over others?
What CSS property is used to make an element float over others?
When an element is positioned absolutely, it is taken out from the __________ flow.
When an element is positioned absolutely, it is taken out from the __________ flow.
Match the CSS positioning types with their descriptions:
Match the CSS positioning types with their descriptions:
What happens when the position property is set to absolute?
What happens when the position property is set to absolute?
Block-level elements in normal flow appear side by side by default.
Block-level elements in normal flow appear side by side by default.
What CSS declaration is used to position an element relative to its normal position?
What CSS declaration is used to position an element relative to its normal position?
What does the 'transform: translate(-50%, -50%)' declaration do?
What does the 'transform: translate(-50%, -50%)' declaration do?
An element with fixed positioning is relative to the body of the document.
An element with fixed positioning is relative to the body of the document.
What unit can be used to position elements relative to the size of their containing element?
What unit can be used to position elements relative to the size of their containing element?
The box positioned with 'top: 100%' and 'left: 100%' will be placed at the __________ of the containing element.
The box positioned with 'top: 100%' and 'left: 100%' will be placed at the __________ of the containing element.
Which property must be set on the container for an absolute positioned child to be positioned relative to it?
Which property must be set on the container for an absolute positioned child to be positioned relative to it?
Using fixed positioning prevents an element from scrolling with the page.
Using fixed positioning prevents an element from scrolling with the page.
How can you position an element at the center of its containing element?
How can you position an element at the center of its containing element?
Which value is NOT accepted by the align-content property?
Which value is NOT accepted by the align-content property?
The order property can change the visual order of flex items in the container.
The order property can change the visual order of flex items in the container.
What CSS property is used to create space between flex items?
What CSS property is used to create space between flex items?
The property used to override the align-items alignment for individual flex items is called _____ .
The property used to override the align-items alignment for individual flex items is called _____ .
Match the following properties with their descriptions:
Match the following properties with their descriptions:
What property determines the stacking order of positioned elements?
What property determines the stacking order of positioned elements?
The z-index property can only be applied to elements with a static position.
The z-index property can only be applied to elements with a static position.
What does the flex-direction property do in flexbox?
What does the flex-direction property do in flexbox?
In flexbox, the axis that runs perpendicular to the main axis is called the ______.
In flexbox, the axis that runs perpendicular to the main axis is called the ______.
Match the CSS classes with their properties:
Match the CSS classes with their properties:
Which of the following best describes the primary function of flexbox?
Which of the following best describes the primary function of flexbox?
Only three values are available for the flex-direction property.
Only three values are available for the flex-direction property.
What is the background color of .box3?
What is the background color of .box3?
What CSS property controls how much a flex item should shrink when there isn't enough space?
What CSS property controls how much a flex item should shrink when there isn't enough space?
The default value of the flex-flow property is row wrap.
The default value of the flex-flow property is row wrap.
In the flexbox model, which property would you use to align items along the main axis?
In the flexbox model, which property would you use to align items along the main axis?
The flex property combines flex-grow, flex-shrink, and _____ properties into a shorthand.
The flex property combines flex-grow, flex-shrink, and _____ properties into a shorthand.
What value of flex-shrink would result in an item shrinking less than others when the space is limited?
What value of flex-shrink would result in an item shrinking less than others when the space is limited?
The flex-wrap property allows items to be placed on multiple lines.
The flex-wrap property allows items to be placed on multiple lines.
What CSS property would you use to arrange items in a column?
What CSS property would you use to arrange items in a column?
Flashcards
Border Collapse
Border Collapse
Combining multiple borders of HTML table elements into a single border.
Zebra-striped table
Zebra-striped table
Alternating background colors in HTML table rows with CSS for better readability.
Accessibility in HTML forms
Accessibility in HTML forms
Using ARIA labels along with placeholders for text inputs to provide support to visually impaired users.
Text input styling
Text input styling
Signup and view all the flashcards
Form accessibility
Form accessibility
Signup and view all the flashcards
Border Styling (Tables)
Border Styling (Tables)
Signup and view all the flashcards
Table Width
Table Width
Signup and view all the flashcards
Input Padding
Input Padding
Signup and view all the flashcards
Containing element
Containing element
Signup and view all the flashcards
Normal flow
Normal flow
Signup and view all the flashcards
position: static
position: static
Signup and view all the flashcards
Relative positioning
Relative positioning
Signup and view all the flashcards
position: relative
position: relative
Signup and view all the flashcards
Absolute positioning
Absolute positioning
Signup and view all the flashcards
Offset properties (top, right, bottom, left)
Offset properties (top, right, bottom, left)
Signup and view all the flashcards
Block-level elements
Block-level elements
Signup and view all the flashcards
Align Items
Align Items
Signup and view all the flashcards
Align Content
Align Content
Signup and view all the flashcards
Align Self
Align Self
Signup and view all the flashcards
Gap Property
Gap Property
Signup and view all the flashcards
Order Property
Order Property
Signup and view all the flashcards
Z-index
Z-index
Signup and view all the flashcards
Flexbox
Flexbox
Signup and view all the flashcards
Flex Container
Flex Container
Signup and view all the flashcards
Flex Item
Flex Item
Signup and view all the flashcards
Main Axis
Main Axis
Signup and view all the flashcards
Cross Axis
Cross Axis
Signup and view all the flashcards
Flex-direction: row
Flex-direction: row
Signup and view all the flashcards
Flex-direction: column
Flex-direction: column
Signup and view all the flashcards
Position: Absolute
Position: Absolute
Signup and view all the flashcards
What's the difference between position: relative
and position: absolute
?
What's the difference between position: relative
and position: absolute
?
Signup and view all the flashcards
Positioning with %
Positioning with %
Signup and view all the flashcards
Centering with transform: translate
Centering with transform: translate
Signup and view all the flashcards
Position: Fixed
Position: Fixed
Signup and view all the flashcards
Viewport
Viewport
Signup and view all the flashcards
Offset Properties
Offset Properties
Signup and view all the flashcards
Flex-shrink Property
Flex-shrink Property
Signup and view all the flashcards
Flex-flow Shorthand
Flex-flow Shorthand
Signup and view all the flashcards
Align Items Property
Align Items Property
Signup and view all the flashcards
Justify Content Property
Justify Content Property
Signup and view all the flashcards
Space-Between Property
Space-Between Property
Signup and view all the flashcards
Space-Around Property
Space-Around Property
Signup and view all the flashcards
Space-Evenly Property
Space-Evenly Property
Signup and view all the flashcards
Align-Content Property
Align-Content Property
Signup and view all the flashcards
Study Notes
Lists, Tables, and Forms
- CSS properties are designed for HTML elements like lists, tables, and forms.
list-style-type
property controls the marker (e.g., disc, circle, square) in ordered (<ol>
) or unordered (<ul>
) lists.
List Styles
-
list-style-type: none;
removes markers. -
list-style-type: disc;
uses disc markers (unordered lists). -
list-style-type: circle;
uses circle markers (unordered lists). -
list-style-type: square;
uses square markers (unordered lists). -
list-style-type: decimal;
uses numbers for ordered lists (e.g., 1. Item). -
list-style-type: decimal-leading-zero;
uses numbers with leading zeroes for ordered lists (e.g., 01. Item). -
list-style-type: lower-alpha;
uses lowercase letters (e.g., a. Item). -
list-style-type: upper-alpha;
uses uppercase letters (e.g., A. Item). -
list-style-type: lower-roman;
uses lowercase roman numerals (e.g., i. Item). -
list-style-type: upper-roman;
uses uppercase roman numerals (e.g., I. Item). -
You can use Unicode escape sequences (e.g.,
\1F44D
) to include special characters like emojis in CSS. -
list-style-image
property lets you specify an image as a bullet point.
Styling Tables
-
border-collapse: collapse;
combines table cell borders into one border. -
Add
border: 1px solid black;
to a table,<th>
, or<td>
to add borders around the table and cells. -
You can also use
width: 100%
andfont-family
for better formatting.
Styling Forms
- Using
placeholder
text instead of a label. - Make forms accessible using
aria-label
for screen readers
Styling Buttons
- Use
linear-gradient
for background styling. - Use
box-shadow
for shadow effects, such asbox-shadow: 0 0 20px #eee;
. border-radius
creates curved corners.- Avoid default borders (
border: none;
), and adjustbackground-position
for smooth hover effects, such asbackground-position: right;
.
Styling Textareas
- Use to disable spellchecking
- Use
min-height
to avoid re-sizing the text area.
Styling Dropdowns
- Customizing
select
elements is done using CSS to style appearance and placeholder. padding
,border
,border-radius
, andbackground-color
can affect visual appearance- Use
cursor: pointer;
for a pointer cursor (this is often explained in next pages/sections)
Positioning and Layouts
- Normal flow: elements stack vertically. Use
position: static
- Relative positioning: elements remain in their normal flow position, but can be adjusted from there using
top
,right
,bottom
,left
. - Absolute positioning: elements are remove from the normal flow, allowing elements to overlap and be positioned in relation to their nearest ancestor element that uses relative or absolute positioning.
- Fixed positioning: elements stay in a fixed position on the page, even when scrolling.
- Sticky positioning: elements behave like relative, but once a specified scroll threshold is reached, they "stick" like a fixed element (useful for navigation).
- Flexbox layouts: control alignment, distribute space, and arrange items in rows or columns
flex-direction
: controls the direction of the main axis (row, column, row-reverse, column-reverse)
flex-wrap
: determines how items wrap (e.g.,wrap
,nowrap
)flex-basis
: sets the initial size of a flex itemflex-grow
: dictates how items expand when available space is presentflex-shrink
: dictates how items shrink when the required space is not present- Flex shorthands:
flex-flow
(combinesflex-direction
andflex-wrap
) - Aligning flex items:
justify-content
(horizontal alignment),align-items
(vertical alignment)`
Overlapping Elements
z-index
: controls the stacking order of overlapping elements (higher values appear on top).
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on CSS properties related to lists, tables, and forms. This quiz covers various list styles and their effects on HTML elements. Challenge yourself to recall the different values for the list-style-type
property and their usages.