Lesson 23-Tips for Using New Features of CSS3

Selectors

  • :nth-child(), :nth-last-child(), :nth-of-type(), :nth-last-of-type(): Select child elements at specific ordinal positions.
  • :not(): Select elements that do not meet the specified conditions.
  • :checked, :disabled, :empty, :enabled, :first-of-type, :last-of-type, :only-child, :only-of-type, :required, :optional: Functional pseudo-class selectors.
  • ::before, ::after, ::first-letter, ::first-line, ::selection: More complete pseudo-element selectors.
  • :target: Select elements that match the current URL fragment identifier.
  • :any-link, :link, :visited: Improved link state selectors.

Text and Fonts

  • @font-face: Custom font import.
  • font-feature-settings, font-kerning, font-language-override, font-size-adjust, font-stretch, font-synthesis: Advanced font control.
  • text-decoration-color, text-decoration-line, text-decoration-style, text-decoration-thickness: Text decoration properties.
  • text-emphasis, text-emphasis-color, text-emphasis-position, text-emphasis-style: Text emphasis style.
  • text-indent: First line indent.
  • text-overflow: Controls the display of ellipsis when text overflows.
  • text-shadow: Text shadow.
  • text-transform: Text transformation (uppercase, all uppercase, all lowercase, etc.).
  • word-break, word-wrap: Control word breaking.

Color and transparency

  • opacity: Set the opacity of the element.
  • rgba(), hsla(): Color functions that support transparent colors.
  • currentColor: Use the text color of the current element as the value.

Box model and layout

  • box-sizing: More flexible box model definition method (content-box, border-box).
  • display: flex, display: grid: Flexible box model and grid layout.
  • align-content, align-items, align-self, flex, flex-basis, flex-direction, flex-flow, flex-grow, flex-shrink, flex-wrap, justify-content, order: Flexbox related properties.
  • grid, grid-area, grid-auto-columns, grid-auto-flow, grid-auto-rows, grid-column, grid-column-end, grid-column-gap, grid-column-start, grid-gap, grid-row, grid-row-end, grid-row-gap, grid-row-start, grid-template, grid-template-areas, grid-template-columns, grid-template-rows: Grid layout related properties.
  • column-count, column-fill, column-gap, column-rule, column-rule-color, column-rule-style, column-rule-width, column-span, column-width: multi-column layout related properties.
  • break-after, break-before, break-inside: control the line break of elements in multi-column or multi-page layout.

Borders and outlines

  • border-radius: rounded borders.
  • border-image: border images.
  • outline-offset: outline margins.
  • box-shadow: box shadows.

Backgrounds and gradients

  • background-size: background image size.
  • background-origin, background-clip: background positioning area.
  • background-blend-mode: Background blending mode.
  • linear-gradient(), radial-gradient(), repeating-linear-gradient(), repeating-radial-gradient(): Gradient background.

Transformations, transitions and animations

  • transform: 2D/3D transformations (rotation, scaling, translation, skewing, etc.).
  • transform-origin: Transformation origin.
  • transition: Defines a smooth transition between different states of an element.
  • transition-delay, transition-duration, transition-property, transition-timing-function: Transition sub-properties.
  • animation: Defines keyframe animations.
  • animation-name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, animation-fill-mode, animation-play-state: Animation sub-properties.

Filtering and blending modes

  • filter: Apply filter effects (blur, grayscale, color shift, etc.).
  • backdrop-filter: Background (behind the element) filter effect.

User Interface

  • appearance: Control the default style of an element (such as a button, input box, etc.).
  • resize: Allow the user to resize an element.
  • cursor: Customize the mouse cursor.
  • nav-index, nav-up, nav-right, nav-down, nav-left: Navigation order and direction.
  • pointer-events: Controls how an element responds to mouse events.

Others

  • will-change: Tells the browser about properties that are expected to change, which helps optimize rendering performance.
  • tab-size: Sets the tab width.
  • object-fit, object-position: Controls the padding and positioning of embedded content (such as <img>, <video>, etc.).
  • counter-reset, counter-increment, content: Customize counters and generated content.
  • quotes: Sets the quote style.
  • writing-mode, direction: Text writing direction and alignment.
Share your love