right align css code example

Example 1: css align center

//HTML
<div class="parent">
	<span>Hello World</span>
</div>

//CSS
.parent {
  display: flex;
  justify-content: center;
  align-items: center;
}

Example 2: align div to the right

display:inline-block; float:right;

Example 3: center text in css

.class {
	text-align: center;
}

Example 4: css align to left

body {
  text-align: left;
}

Example 5: css right

.right {
  position: fixed; /* the fixed pos makes it work */
  right: /*how much you want to move it right 
    put % or px or rem at end of the amount */;
}

Example 6: css text align center

body {
  text-align: center;
}

Tags:

Css Example