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

Slanted DIVs!!!!!

Can anyone in a clear and concise "SHORT" manner, tell me how it is possible to created the slanted divs via css?

https://www.pinterest.com/pin/416090453051001528/

Zac Gordon Nick Pettit

5 Answers

You can use the before and after pseudo classes to create this effect. You can view my example below

Demo Here

Using the transform property with CSS, or some type of JS framework. More Info...

But how do you do what THEY did I guess is what I'm asking to get a div element, and have the border bottom be at a slant. I'm asking so that I can fiddle around with it, but the link above doesn't make sense to me... and I guess you have to undo the trasnsform afterwards to keep the inside straight?? Help..

They could have 3 divs wrapped in a div, slant the top and bottom ones, and put the content in the middle one, and set the background image on the wrapper.