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

'Infinite' Div

Okay, so I am making a blog. I want shortened versions of each article to be on the homepage, and you can scroll through them, with the one at the top being the newest and the one at the bottom being oldest. Link to my code http://codepen.io/anon/pen/qpHEn (bear in mind it looks much better on my browser than in the codepen, but can you please edit codepen and send it back to me? looking forward to your replies!

1 Answer

I am a bit unclear what you are aiming for. Would you mind elaborating?

You can try putting each article in it's own div. Set each div to a set height and then set the overflow to hidden. This will hide all content past the box.

for example:

#article_1 {
    width:auto;
    height:300px;
    overflow:hidden;

}

Also... you are missing a </p> tag at the end of the snippet.

another way would be using php or a script to shorten articles, but you may not have gotten there yet.