Horizontally centering is managed by the justify-content property and vertical centering by align-items property.Įxample 1: This example set the text content vertically align to center. The text content can be aligned vertically by setting the following display properties:Īlign-items and justify-content are the important properties to absolutely center text horizontally and vertically. Vertical align to center: The flexbox property is used to set the content to vertical align. Basically it is one-dimensional layout syntax. The flexbox was added to the CSS standards a few years ago to manage space distribution and element alignment. Microsoft Word users are familiar with horizontally aligning text, but a few tricks make vertical text alignment equally easy. Order of any element can be easily changed without editing the HTML section. The margin doesn’t collapse with the content margins. It is easy to positioning child elements and the main container. The flex property is much responsive and mobile friendly. It is used to set the length of flexible items.
0 Comments
|
AuthorJoe ArchivesCategories |