Skip to content
Wizard Commerce

Wizard Commerce

Magento / Adobe Commerce Specialists

  • HOME
  • About Us
  • Services
  • Contact
  • Blog
Posted on 19th Feb 2025 by wizardcommerce

Pure CSS ellipsis when text doesn’t fit block

If text is too long for a block on your HTML page, use this tip to truncate it with three dot ellipsis ...

.myBlock {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

Note: the block’s display must not be set to inline.

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...

Related

CategoriesCSS

Post navigation

Previous PostPrevious DS_Store files in a tar on MacOS
Next PostNext Vim: copy contents of current file to MacOS clipboard
Create a website or blog at WordPress.com
  • Reblog
  • Subscribe Subscribed
    • Wizard Commerce
    • Already have a WordPress.com account? Log in now.
    • Wizard Commerce
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d