Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AFPoster

macrumors 68000
Original poster
Jul 14, 2008
1,547
141
Charlotte, NC
So I know using border-radius we can round out the corners of a <div>. Is there a want to make a slanted corner like in the screen shot?
 

Attachments

  • 2012-12-31_12-27-46.jpeg
    2012-12-31_12-27-46.jpeg
    18.9 KB · Views: 529

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
Personally I'd use a tiny .png image background image positioned bottom right of a div container and offset to the left a bit. The div would also be set with a similar border color and size. Using an image assures cross browser compatibility at the sacrifice of a little bandwidth but it will be cached and file size would be very small.

Beyond that, there are ways to do it purely with CSS although it gets a little complex and might not be fully MSIE compatible. Please visit this site which allows you to fiddle with both the HTML and CSS to customize slanted corners:

http://jsfiddle.net/NGLN/k86Mr/2/

(You'll notice if you comment out .box .head selector with the image you can still see the slanted corners which is what you asked about, the example creates more than just slanted corners but a nice looking sidebar dialog or content block like you'd typically find on a site) FYI

-jim
 
Last edited:

AFPoster

macrumors 68000
Original poster
Jul 14, 2008
1,547
141
Charlotte, NC
Personally I'd use a tiny .png image background image positioned bottom right of a div container and offset to the left a bit. The div would also be set with a similar border color and size. Using an image assures cross browser compatibility at the sacrifice of a little bandwidth but it will be cached and file size would be very small.

Beyond that, there are ways to do it purely with CSS although it gets a little complex and might not be fully MSIE compatible. Please visit this site which allows you to fiddle with both the HTML and CSS to customize slanted corners:

http://jsfiddle.net/NGLN/k86Mr/2/

(You'll notice if you comment out .box .head selector with the image you can still see the slanted corners which is what you asked about, the example creates more than just slanted corners but a nice looking sidebar dialog or content block like you'd typically find on a site) FYI

-jim

thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.