In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to set css beyond the display ellipsis, the article introduces in great detail, has a certain reference value, interested friends must read it!
Css setting exceeds the method of showing ellipsis: 1, use the "overflow:hidden;" statement to hide the excess part; 2, use the "text-overflow:ellipsis;" statement to show the ellipsis symbol to represent the hidden part when the text overflows the containing element.
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
There are two situations in which the css setting exceeds the display ellipsis
A single line of text overflows to show ellipses.
Multiline text overflows to show ellipses.
But the core code is the same: you need to use "overflow:hidden;" to hide the excess, and then use "text-overflow:ellipsis;" to display as an ellipsis when the text exceeds.
Overflow:hidden; does not display content that exceeds the size of the object, just hides the excess
Text-overflow:ellipsis; is displayed when the text object overflows. Of course, you can also set the property to clip to not display dots.
Implementation code
1. Single-line text overflow shows ellipsis.
* {margin: 0pxashing padding: 0px.box {width: 300pxashing height: 500pxashing margin: 50px auto;} .boxes {width:220px; overflow:hidden; white-space: nowrap Text-overflow:ellipsis;-oMutttext overflow flows
Css single-line text shows ellipsis beyond its length
Css single-line text shows ellipsis beyond its length
Effect picture:
2. Multi-line text overflow shows ellipsis.
* {margin: 0pxashing padding;} .box {width: 280px; height: 62px; margin: 50px auto; overflow: hidden; text-overflow: ellipsis Display:-webkit-box;-webkit-line-clamp: 3;-webkit-box-orient: vertical } css multi-line text shows ellipsis over length, and css multi-line text shows ellipsis over length.
The above is all the content of the article "how to set css beyond the display ellipsis". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.