P粉2760641782023-08-16 09:59:41
You can add the fill
attribute directly on the polygon as follows:
<div className="scroller scroller-top"> <svg className="scroller__thumb" xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" > <polygon points="0 50 37 68 37 32 0 50" fill="rgb(24,24,62)" /> <polygon points="100 50 64 32 64 68 100 50" fill="rgb(24,24,62)" /> </svg> </div>
Bonus: If you are using React, the class
attribute should be className
.