In CSS, you can use the "line-height" attribute to adjust the line spacing of the text beyond the next line. You only need to add the "line-height: line spacing value;" style to the text element.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
#How to adjust the line spacing when the css text exceeds the next line
You can use the line-height attribute to set when the text exceeds the next line. Yes Line spacing. The line-height property sets the distance between lines (line height).
The example is as follows:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style type="text/css"> div{ width:200px; height:100px; border:1px solid black; overflow:hidden; line-height:200%; } </style> </head> <body> <div>css设置文本显示高度超出部分隐藏css设置文本显示高度超出部分隐藏css设置文本显示高度超出部分隐藏css设置文本显示高度超出部分隐藏css设置文本显示高度超出部分隐藏css设置文本显示高度超出部分隐藏css设置文本显示高度超出部分隐藏</div> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of How to adjust line spacing when css text exceeds the next line. For more information, please follow other related articles on the PHP Chinese website!