auto align a div to center code example Example: how to assign something in center inside a div P { text-align: center } H2 { text-align: center }