HOW TO VERTICALLY ALIGN TEXT ON GEMPAGES HOW TO
RELATED: How to Change the Alignment of the Numbers in a Numbered List in Microsoft Word This tool also allows you to be selective with the text you align horizontally, giving you more control over what you can do to your document. Furthermore, this percentage is one that corresponds to the parent element’s line height.Horizontal alignment, also known as centered alignment, positions the text evenly between the margins on either side of the page. This length is the addition of the parent element’s baseline and the percentage value. Text-decoration: underline #d81aba dotted Ī percentage value will align the baseline of the selected element to a length.
HOW TO VERTICALLY ALIGN TEXT ON GEMPAGES CODE
Moreover, when you run the code in your web browser, you’ll observe that the box moves up to the line of the parent: This length is the addition of the parent’s element baseline and the specified length.ĭetails of vertical-align with a length value are in the next code block. Text-decoration: underline #2517c3 dotted Ī length value for vertical-align will align the baseline of the selected element to a specific length. In the next code block, vertical-align: text-bottom aligns the text “op”: This is the opposite of vertical-align: top, and it aligns the bottom of the parent element’s font with the bottom of the selected element. Text-decoration: underline #59486e dotted These details are in the next code block: The text-top value will align the top of the parent element’s font with the top of the selected element. Text-decoration: underline #0b1861 dotted This is super Superscript text alignment. This is the opposite of vertical-align: sub and it turns the selected child element into a superscript.įurthermore, the following code block contains details of vertical-align: super:
Text-decoration: underline #61430b dotted When you run the next code block, the web browser renders the text “Subscript text” as a subscript. Vertical-align: sub turns the selected child element to a subscript in the parent.
Text-decoration: underline #a51111 dotted The bottom value will align the bottom of the selected child element to the bottom of the entire line that belongs to the parent element.įurthermore, the box in the next code block moves to the bottom line of its parent element: Text-decoration: underline #9a0e7e dotted When running the next code block, you’ll observe the effect vertical-align: middle: Moreover, the browser adds the result to the baseline. The web browser arrives at the middle by calculating the x-height of the parent element and dividing it by two. Vertical-align: middle aligns the selected element to the middle of its parent element. Text-decoration: underline #084ed5 dotted The next code provides a visual presentation of vertical-align: top. This aligns the top of the selected child element to the top of the line that the child element sits in. In the next code block, the box aligns to the parent’s baseline: This aligns the baseline of a child element with the baseline of the parent element. Let’s take a look at each one more closely. The following values work with CSS vertical-align: