Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Foundations Text, Fonts, and Lists More Text Properties

Randy Cole
PLUS
Randy Cole
Courses Plus Student 2,494 Points

So what's the difference between overflow: hidden and text-overflow: clip and is it really necessary to have both?

Not sure why both overflow: hidden and text-overflow: clip are both needed

2 Answers

I think this is actually mentioned in the video. You need both of them to accomplish this text trimming.

Where the text-overflow: clipped, will only be applied if the container has its overflow property set to something other its default value of 'visible.'

So declaring overflow: hidden, enables text-overflow: clip, or another value, to function correctly in the container.

After looking at a couple of resources, there might be no difference between the two. It may only be necessary to provide one since they both cover the same function.

Resources used:

http://www.w3schools.com/cssref/pr_pos_overflow.asp http://css-tricks.com/almanac/properties/t/text-overflow/