Looking to create a container with an upward arrow attached to it, but encountering some challenges. I've used the border drawing trick in the past, which seems like a possible solution. However, it seems limited to specific sizes since you need to specify border in em or px.
The shape I have in mind looks something like this:
.
/ \
/ \
/ \
| flex |
| |
Where the content area can adjust its size based on a percentage of the parent container.
Below is the CSS code, highlighting the problematic section:
.metric {
display: inline-block;
position: relative;
height: 150px;
width: 50%;
background: lawngreen;
}
.metric:after {
position: absolute;
top: -25px;
left: 0;
content: '';
background: white;
width: 100%;
height: 0;
border: 75px solid white; /* this fixed width is the problem */
border-top: none;
border-bottom: 25px solid lawngreen;
box-sizing: border-box;
}
Explore the jsfiddle link for a visual representation: http://jsfiddle.net/C8XJW/2/
Does anyone have any ideas on how to achieve this design?