CSS
This is a variation of my solution for challenge #2. Just add the class "triangle" to a block element, and specify the lines in the CSS variable --stars:
--stars
.triangle { --stars: 10; width: calc(2 * var(--stars) * 10px); height: calc((var(--stars)) * 15px); background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10px" height="15px" viewBox="0 0 10 15"><text x="5" y="12" fill="black" dominant-baseline="middle" text-anchor="middle">*</text></svg>'); background-position: top center; clip-path: polygon(50% 0, 100% 100%, 0% 100%); }
The idea is having an inline SVG background with the asterisks, then clipping the shape of the triangle. Here is a demo on Codepen:
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
CSS
This is a variation of my solution for challenge #2. Just add the class "triangle" to a block element, and specify the lines in the CSS variable
--stars
:The idea is having an inline SVG background with the asterisks, then clipping the shape of the triangle. Here is a demo on Codepen: