Home  >  Article  >  Web Front-end  >  How to align the bottom of text in css

How to align the bottom of text in css

藏色散人
藏色散人Original
2020-12-24 09:23:088064browse

How to align the bottom of text in css: first create an HTML sample file; then define a div block; and finally set the css style to "display:table-cell;vertical-align:bottom;" Just align the bottom of the text.

How to align the bottom of text in css

The operating environment of this tutorial: Windows 7 system, HTML5&&CSS3 version, Dell G3 computer.

Recommended: "css video tutorial"

css method to align the bottom of the text in the div

1. Create HTML element

<div>文字在div的底部对齐</div>

2. Add css style

div{
    width:200px;
    height:50px;  /*设置div的大小*/
    border:4px solid #beceeb; /*为了便于观察,显示出边框*/
    display:table-cell; 
    vertical-align:bottom;
}

Rendering:

How to align the bottom of text in css

For more programming-related knowledge, please visit:programmingvideo! !

The above is the detailed content of How to align the bottom of text in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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