left align css code example

Example 1: how to align elements horizontally in css

.row {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
}
.block {
  width: 100px;
}

Example 2: center text in css

.class {
	text-align: center;
}

Example 3: css align to left

body {
  text-align: left;
}

Example 4: css text align center

body {
  text-align: center;
}

Example 5: css text align right

body {
  text-align: right;
}

Example 6: align centre

.headerTwoDiv{
			margin:1% auto;
			margin-right: auto; margin-left: auto; width: 21%; 
			padding-top: 11px;
		}

Tags:

Css Example