Home > Article > Web Front-end > How to set font to display left in css
How to set the font to be displayed on the left in css: You can use the text-align attribute to set it, such as [h2 {text-align:left}]. The text-align attribute specifies the horizontal alignment of the element's text, and left means arranging the text to the left.
Related attribute introduction:
The text-align attribute specifies the horizontal alignment of the element's text.
(Learning video sharing: css video tutorial)
Attribute value:
left Arrange the text to the left. Default: determined by the browser.
#right Arrange the text to the right.
#center Arrange the text to the center.
#justify Achieve the effect of aligning text on both ends.
#inherit Specifies that the value of the text-align attribute should be inherited from the parent element.
Example:
h1, h2, 和 h3元素设置文本的对齐方式: h1 {text-align:center} h2 {text-align:left} h3 {text-align:right}
Related recommendations: CSS tutorial
The above is the detailed content of How to set font to display left in css. For more information, please follow other related articles on the PHP Chinese website!