CSS Align


Go to main Page

Align Property in CSS


Align property in CSS is used to align the elements.

you can align it in center,left and right.

Align in center



.container {
  width:200px;
  height:200px;
  margin:auto;
  }


By using this code we can align container in center.


Align on left side



.container {
  width:200px;
  height:200px;
  float:left;
  }


Align on right side



.container {
  width:200px;
  height:200px;
  float:right;
  }


To align container perfectly



.container {
  width:200px;
  height:200px;
 text-align:center;
  }