Home > Web Front-end > HTML Tutorial > I want 1 line of text to be centered. I also want 2 lines of text to be centered. How to write CSS_html/css_WEB-ITnose

I want 1 line of text to be centered. I also want 2 lines of text to be centered. How to write CSS_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:10:13
Original
1192 people have browsed it

I want 1 line of text to be centered and 2 lines of text to be centered. How to write CSS


Reply to the discussion (solution)

What does it mean. . Didn't understand. .

Center them all? I don’t understand

I don’t know what you mean. Directly set text-align:center to the parent element; all the content is correct.

I forgot to mention that it is vertically centered. There is also a question: how to make the picture vertical Center

Use js for vertical centering

http://www.17leba.com/archives/392

text-align:center; margin: 0 auto

Use position

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template