The code of the multi-line text vertical center instance implemented by CSS,

Source: Internet
Author: User

The code of the multi-line text vertical center instance implemented by CSS,

Example code of multi-line text vertical center implemented by CSS:
It is very easy to vertically center a line of text in the container. It only requires two lines of code, for example:

 

div{  width:100px;  height:100px;  line-height:100px;}

 

The above code can achieve the vertical center effect of a single line of text in the div, as long as the div's height attribute value and line-height are set to the same.
However, the above Code cannot vertically center multiple lines of text. Let's look at another code example:

 

<! DOCTYPE html> 

 

The above code implements vertical center alignment of multiple lines of text. We will not introduce it here. You can apply it directly.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 9626.

For more information, see: http://www.softwhy.com/divcss/

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.