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

How to align the bottom of text in css

藏色散人
Release: 2023-01-04 09:37:53
Original
8115 people have browsed it

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>
Copy after login

2. Add css style

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

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!

Related labels:
css
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