{"id":14119,"date":"2011-09-06T18:49:17","date_gmt":"2011-09-07T01:49:17","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14119"},"modified":"2014-03-28T08:59:47","modified_gmt":"2014-03-28T15:59:47","slug":"text-overflow","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/t\/text-overflow\/","title":{"rendered":"text-overflow"},"content":{"rendered":"
The Note that Text overflow can only happen on block or inline-block level elements, because the element needs to have a width in order to be overflow-ed. The overflow happens in the direction as determined by the direction<\/a> property or related attributes. <\/p>\n The following demo displays the behavior of the Setting An old version of the spec<\/a> says you could use an URL to an image for the ellipsis, but it looks as if that was dropped.<\/p>\n There is a two-value syntax, e.g. I’m not sure where The The text-overflow property in CSS deals with situations where text is clipped when it overflows the element’s box. It can […]<\/p>\n","protected":false},"author":1036,"featured_media":0,"parent":13949,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-almanac-single.php","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","_share_on_mastodon":"0","_share_on_mastodon_status":"%title% %permalink%"},"tags":[],"acf":[],"share_on_mastodon":{"url":"","error":""},"jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/14119"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/1036"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=14119"}],"version-history":[{"count":23,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/14119\/revisions"}],"predecessor-version":[{"id":167004,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/14119\/revisions\/167004"}],"up":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/13949"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=14119"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=14119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}text-overflow<\/code> property in CSS deals with situations where text is clipped when it overflows the element’s box. It can be clipped (i.e. cut off, hidden), display an ellipsis (‘\u2026’, Unicode Range Value U+2026) or display an author-defined string (no current browser support for author-defined strings).<\/p>\n
.ellipsis {\r\n text-overflow: ellipsis;\r\n\r\n \/* Required for text-overflow to do anything *\/\r\n white-space: nowrap;\r\n overflow: hidden;\r\n}<\/code><\/pre>\n
text-overflow<\/code> only occurs when the container’s
overflow<\/code><\/a> property has the value
hidden<\/code>,
scroll<\/code> or
auto<\/code> and
white-space: nowrap;<\/code>.<\/p>\n
text-overflow<\/code> property including all the possible values. Browser support varies!<\/p>\n
<\/code>Check out this Pen!<\/a><\/pre>\n
overflow<\/code> to
scroll<\/code> or
auto<\/code> will display scrollbars to reveal the additional text, while
hidden<\/code> will not. The hidden text can be selected by selecting the ellipses.<\/p>\n
Old Stuff<\/h3>\n
text-overflow: ellipsis ellipsis;<\/code>, that would control the overflow on the left and right sides of the same container. I’m not sure how that would be possible to achieve. Perhaps centered text in a too-small container? The new spec<\/a> says this, as well as defining a string, is “at risk.”<\/p>\n
ellipsis-word<\/code> came from. It’s not in the spec or in any other documentation other than on WebPlatform.org<\/a>.<\/p>\n
text-overflow<\/code> property used to be <\/em>shorthand for the combination of
text-overflow-mode<\/code> and
text-overflow-ellipsis<\/code>, but not anymore and those separate properties don’t exist.<\/p>\n
Related Properties<\/h3>\n
\n
white-space<\/code><\/a><\/li>\n
overflow<\/code><\/a><\/li>\n
word-break<\/code><\/a><\/li>\n
width<\/code><\/a><\/li>\n<\/ul>\n
Other Resources<\/h3>\n
\n
Browser Support<\/h3>\n
\n\n
\n Chrome<\/span><\/th>\n Safari<\/span><\/th>\n Firefox<\/span><\/th>\n Opera<\/span><\/th>\n IE<\/span><\/th>\n Android<\/span><\/th>\n iOS<\/span><\/th>\n<\/tr>\n<\/thead>\n\n \n 25+<\/td>\n 5.1+<\/td>\n 19+<\/td>\n 12.1+<\/td>\n IE8+<\/td>\n 2.1+<\/td>\n 3.2+<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"