how to align text css code example

Example 1: center h1 css

h1 {
    width:500px;
    margin: 0 auto;
    background: gray;
    text-align: center;
}

Example 2: css text align center

/* Character-based alignment in a table column */

text-align: center;

/* The inline contents are centered within the line box. */

Example 3: how to center text in css

.class {
	text-align: center;
}

Example 4: text align css

p{
    text-align:center;/*values: center, left, right, etc...*/
}

Example 5: css text align center

body {
  text-align: center;
}

Example 6: css text align left

body {
  text-align: left;
}

Tags:

Misc Example