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

Design question

Hi guys!

I was wondering how you design gurus would create the blue triangle with flat bottom from this screenshot: https://www.dropbox.com/s/yr3i0aa7kg5c77g/Screenshot%202016-04-23%2017.34.10.png?dl=0

my designer created it but I have my questions about the actual feasibility

thanks guys!

1 Answer

Steven Parker
Steven Parker
243,656 Points

It's quite feasible, with several implementation choices, including: <div style="position:absolute; top:0;right:0;height:0;width:240px;border-top:200px solid navy;border-left:200px solid transparent;"></div>

  • a background image (could be a .svg)
  • a foreground image (with text overlaid)
  • just a CSS border

An example of the latter:

<style>
  .angle {
    margin-left: 600px;
    height: 0px;
    width: 40px;
    border-top: 200px solid navy;
    border-left: 200px solid transparent;
  }
</style>
<div class='angle'></div>

Thanks Steven! Will try this as soon as I start with the project and get back to you. one quick question, with the CSS border approach, I cant think of a text overlay, you? On second thought, I can achieve this with an absolute positioned text div off course!

Thanks!