If you're trying to create a design similar to this:
<div class="box"></div>
What we're aiming for is using the border as the main visual element.
We specifically want the bottom left border to be see-through.
If we give it a suitable height, it starts to resemble the image you provided.
.box {
border-right: 300px solid red;
border-bottom: 10px solid transparent;
height:100px;
}
This essentially creates a drawing made entirely of borders, manipulated and sized to appear solid.
JSFiddle link
However, making it responsive becomes more challenging since percentage values aren't supported with borders.
You're limited to a fixed maximum border size—in this case, we'll stick with 300px from before. So our .box
class now becomes:
.box {
border-right: 300px solid red;
border-bottom: 10px solid transparent;
height:100px;
width:100%;
right:0px;
float:right;
}
To make it seem like the solid box is actually floating left, we adjust by floating right. A wrapper with hidden overflow will maintain the appearance of adjustment even though the border-image
doesn't change in size:
.box_wrapper{
width:100px;
overflow:hidden;
left:0px;
}
In our HTML, we add a wrapper:
<div class="box_wrapper">
<div class="box"></div>
</div>
The end result is a clever workaround for responsiveness!
Second JSFiddle
If you adjust the size of the .box_wrapper
in the fiddle, the bordered box would appear to resize.
Note: There might be a more efficient method to achieve this effect!