Learning Log logo

CSS

Cascading Style Sheets (CSS)

A language which dictates how HTML elements are to be displayed or styled.

Best practices

  • Comments: provide a brief explanation or label for the code
  • Use responsive styling to ensure the layout adapts to screen size appropriately
  • Accessibility:
    select fonts which are appropriate for low vision
    ensure sufficient contrast
    ensure spacing is suitable for magnification
  • Formatting:
    ensure a logical order
    group code with the same styling
    utilise media queries
  • Validate the code: check the code for errors using a CSS validator

Hints

  • Check the spelling of each class
  • Check container levels
  • Check folder pathway
  • Check color contrast
  • Check mobile version in the portrait and landscape modes
  • Google Fonts provides a range of free font options
  • Use media queries to make the webpage responsive to different screen sizes

Flexbox

Flexbox is a style of layout that allows containers to flexibly adjust to different screen sizes.

Parent properies

  • justify-content
  • align-items
  • flex-wrap
  • align-content
  • gap
  • flex-direction
  • flex-flow

Child properites

  • flex
  • flex-basis
  • flex-shrink
  • flex-grow
  • order
  • align-self

One & Done