Input file element inside SVG Rounded Rectangle

前端 未结 1 1722
一向
一向 2021-01-24 09:40

Is it possible to keep input file element inside SVG?

I tried something like this, but it\'s not showing file element :



        
相关标签:
1条回答
  • 2021-01-24 10:18

    What you want is the svg foreignObject element :

    <svg width="80" height="40">
    <rect x="5" y="2" rx="2" ry="2" width="70" height="30"style="fill:red;stroke:black;stroke-width:5;opacity:0.5"/>
    <foreignObject width="70" height="30" x="7" y="3"><input type="file"name="upload"></foreignObject>
    </svg>

    0 讨论(0)
提交回复
热议问题