html - Creating a skewed triangle shape -


Is it possible to create a shape created by it? But without javascript but CSS3 (with & lt; div & gt; )?

Actually this:

 for  (var i = 0; i & lt; coords.length; i + = 1) {if (coord ((+ 1)] = undefined {ctx.beginPath (); Ctx.moveTo (Coord [i] .x, Coord [i] .y); Ctx.lineTo (Cores [(I + 1]]. X, Cores [(I + 1]]. Y); Ctx.stroke (); } And {ctx.beginPath (); Ctx.moveTo (Coord [i] .x, Coord [i] .y); Ctx.lineTo (Cores [0]. X, Coors [0] .y); Ctx.stroke (); }}  

So do you need to connect with each other?

If you do not want to use the canvas , then Use svg .

  and lt; Svg width = "100" height = "100" & gt; & Lt; Path d = "M0 0 l100 10 L-40 90z" fill = "none" stroke = "black" stroke-width = "2" /> & Lt; / Svg & gt; The path to <8> 8,88,10,30,30,49,10  


Code> will M8 8 L10 10 L30 40 L49 10z .

  & lt; Svg width = "49" height = "40" visible box = "0 0 50 41" & gt; & Lt; Path d = "M8 8 L10 10 L30 40 L49 10z" fill = "none" stroke = "black" stroke-width = "2" /> & Lt; / Svg & gt;  


To apply a click event to the shape, you can use the pointer-events : #test on all .

  #test {pointer-events: all; }  
  & lt; Svg width = "49" height = "40" visible box = "0 0 50 41" & gt; & Lt; Path id = "test" d = "M8 8 L10 10 L30 40 L49 10z" fill = "none" onclick = "warning ('works')" stroke = "black" stroke-width = "2" /> & Lt; / Svg & gt;  


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -