CSS Alignment Tutorial
CSS alignment tutorial - HTML elements can be aligned horizontal or vertical. It can be aligned on the left, center, right, or top, bottom, and center.
Steps: To align HTML element horizontally Center:
- Please keep in mind that the black level element takes full available width.
- Assigning a constant width value of the block-level element prevents it from stretching out to the edge of the container. Now, assign margin: auto; property to the block element. In this case, the block-level element is aligned horizontally center, and the remaining empty space divided equally into the left and right margins.