how to center text in css w3schools code example Example 1: text align center text-align: center; Example 2: css text align right body { text-align: right; }