CSS EXAMPLES

Simple CSS examples:

  1. Changing text color:

body {
  color: red;
}
  1. Changing background color:

body {
  background-color: yellow;
}
  1. Adding a border:

img {
  border: 2px solid black;
}
  1. Changing font size:

h1 {
  font-size: 36px;
}
  1. Aligning text:

  1. Adding padding:

Complicated CSS examples

CSS can be used to create complex layouts, animations, and interactions.

  1. Creating a responsive navigation bar with dropdown menus:

  1. Creating a responsive grid layout with CSS Grid:

  1. Creating a complex animation with keyframes:

Last updated