Home  >  Article  >  Web Front-end  >  How to hide excess text in css3

How to hide excess text in css3

WBOY
WBOYOriginal
2021-12-08 16:02:143133browse

In CSS, you can use the overflow attribute to set the exceeded text to be hidden. This attribute is used to specify what happens when the content exceeds the element box. When the value of the attribute is "hidden", the exceeded content will be hidden, the syntax is "text element {overflow:hidden;}".

How to hide excess text in css3

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

How to hide the exceeded text in css3

In css, if you want to hide the exceeded text, you can use the overflow attribute, overflow Properties specify what happens when content overflows the element's box.

The attribute values ​​are as follows:

How to hide excess text in css3

The example is as follows:




    
    
    
    Document
    
    
超出隐藏超出隐藏超出隐藏超出隐藏超出隐藏超出隐藏超出隐藏超出隐藏

Output result:

How to hide excess text in css3

(Learning video sharing: css video tutorial)

The above is the detailed content of How to hide excess text in css3. 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