I'm looking to create a div in the shape of a shopping tag, and have gotten pretty far, but I want to make it pixel perfect by rounding the triangle pointer both at it's peak and just before blending into the tag.
Larger detail:
Wanted, the types of rounded edges here:
Bonus points if I can get the little white dot somewhere (I tried content: "·" with little luck).
I've looked up stackoverflow items on rounded triangles, so this seems doable, but they're all standalone triangles, not added to the end of a div. And I'm trying to do it w/o making a standalone triangle next to my rectangular div.
Thank you for any ideas!
.tag {
background-color: red;
border-radius: 0 3px 3px 0;
color: #fff;
display: inline-block;
font-family: verdana;
font-size: 12px;
height: auto;
line-height: 12px;
margin-left: 9px;
padding: 3px 6px 3px 3px;
position: relative;
}
.tag:before {
content: "";
line-height: 6px;
position: absolute;
width: 0;
height: 0;
border-top: 9px solid transparent;
border-bottom: 9px solid transparent;
border-right: 9px solid #f00;
top: 0;
left: -9px;
}
<div class="tag">hello</div>
--- EDIT AFTER SUGGESTIONS ---
.tag {
background-color: red;
border-radius: 0 3px 3px 0;
clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
color: #fff;
display: inline-block;
font-family: verdana;
font-size: 12px;
filter: url('#goo');
height: auto;
line-height: 12px;
margin-left: 15px;
padding: 3px 12px 3px 15px;
position: relative;
}
<div class="tag">Hello</div>
<svg style="visibility: hidden; position: absolute;" width="0" height="0" xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<filter id="goo"><feGaussianBlur in="SourceGraphic" stdDeviation="5" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9" result="goo" />
<feComposite in="SourceGraphic" in2="goo" operator="atop"/>
</filter>
</defs>
</svg>
This looks pretty much there, and the point is a bit rounded. But the edges leading onto the rectangle are still sharp, and it's now rounded the right side of the tag a great deal. I'm guessing the blur values need to be adjusted so I'm looking in that direction now, though it's a new topic for me.