The wonders of text ellipsis

A common issue when working with constrained UI elements is text overflowing outside of it’s parent or breaking into addition lines (thus breaking the layout).

This is most commonly seen with the direct and placeholder values for input fields on form …


This content originally appeared on Ugly Duck and was authored by Bradley Taunt

A common issue when working with constrained UI elements is text overflowing outside of it's parent or breaking into addition lines (thus breaking the layout).

This is most commonly seen with the direct and placeholder values for input fields on form elements. For example, the following input placeholder will be cutoff from the user’s view:

See the Pen Text Ellipsis (Input Placeholders) by Bradley Taunt (@bradleytaunt) on CodePen.

Luckily, 3 simple CSS parameters can fix this.

input::placeholder {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

This allows the user to understand there is more content cut out from their current view. It’s not ideal to ever have content overflowing outside of the parent container, but if you need to the best workaround is to use text-overflow.


This content originally appeared on Ugly Duck and was authored by Bradley Taunt


Print Share Comment Cite Upload Translate Updates
APA

Bradley Taunt | Sciencx (2016-11-15T00:00:00+00:00) The wonders of text ellipsis. Retrieved from https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/

MLA
" » The wonders of text ellipsis." Bradley Taunt | Sciencx - Tuesday November 15, 2016, https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/
HARVARD
Bradley Taunt | Sciencx Tuesday November 15, 2016 » The wonders of text ellipsis., viewed ,<https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/>
VANCOUVER
Bradley Taunt | Sciencx - » The wonders of text ellipsis. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/
CHICAGO
" » The wonders of text ellipsis." Bradley Taunt | Sciencx - Accessed . https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/
IEEE
" » The wonders of text ellipsis." Bradley Taunt | Sciencx [Online]. Available: https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/. [Accessed: ]
rf:citation
» The wonders of text ellipsis | Bradley Taunt | Sciencx | https://www.scien.cx/2016/11/15/the-wonders-of-text-ellipsis/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.