Question

I want to be able to create a transparent background using only CSS but with an angle on one end. I've found various ways of trying to do it, but can't quite get it. I don't really want to use any scripting, just CSS.

Background image would need to look like this:

square with slanted side

Was it helpful?

Solution

You could do it using borders: http://jsfiddle.net/wNhjb/

#shape {
   height: 0; 
   width: 80px;
   border-top: 80px solid blue;
   border-left: 40px solid transparent;
}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top