SVG`use`元素位置绝对

时间:2015-01-20 10:18:34

标签: html css svg

我有这个标记

<object>
    <svg style="width:100%;height:100%">
        <use x="0" y="0" xlink:href="#hello" transform="scale(2)"/>
    </svg>
</object>

并希望use标记位置绝对。但添加position:absolute;似乎没有做任何事情。是不是可以将use标记位置设为绝对位置,还是我做错了什么?

<g id="hello">
    <path d="M233.9,51c5.9,4.2,8.8,8.7,8.8,13.7c0,2.1-0.7,4.1-2.2,6c-1.5,1.8-3.8,2.8-6.9,2.8c-2.3,0-4.3-0.8-6-2.3
        c-1.7-1.6-3-3.8-3.7-6.8l-1.2-4.7c-0.8-3.4-2.3-5.9-4.4-7.3c-2.1-1.4-5-2-8.4-2c-7.4,0-13.6,3.2-18.7,9.7c-5.1,6.4-7.6,15-7.6,25.7
        c0,9.8,2.8,18.6,8.4,26.3c5.6,7.8,13.2,11.7,22.7,11.7c6.7,0,12.7-2.2,18-6.6c3-2.5,6.3-6.5,10.1-12.1l2.7,1.7
        c-3.7,7.8-7.6,13.9-11.6,18.5c-7.8,8.7-16.9,13-27.2,13c-10.1,0-19-4-26.8-11.9s-11.6-18.8-11.6-32.4c0-13.4,4.2-24.9,12.7-34.6
        c8.5-9.6,19.2-14.5,32.1-14.5C221.1,44.7,228,46.8,233.9,51z"/>
    <path class="st1" d="M205.6,52.6l-18.4,19c0.5-1.6,1.1-3.1,1.7-4.5l13-13.4C203.1,53.2,204.3,52.8,205.6,52.6z M210.8,52.2
        L185.8,78c-0.1,1-0.2,2-0.3,3.1l27.6-28.5C212.4,52.4,211.6,52.3,210.8,52.2z M217,53.9c-0.1,0-0.1-0.1-0.2-0.1l-31.4,32.4
        c0,0.9,0,1.8,0.1,2.6L218.2,55C217.8,54.6,217.4,54.2,217,53.9z M220.5,60c-0.2-0.7-0.4-1.2-0.6-1.8l-34,35.1
        c0.1,0.8,0.3,1.5,0.4,2.3l34.2-35.3L220.5,60z M221.7,64.7l-0.1-0.4l-34.1,35.1c0.2,0.7,0.5,1.3,0.7,2l34-35.1
        C222,65.8,221.9,65.3,221.7,64.7z M223.8,69.7l-34,35.1c0.3,0.6,0.6,1.2,1,1.7l34.2-35.3C224.5,70.8,224.1,70.2,223.8,69.7z
         M227.5,73.6l-34.9,36c0.3,0.4,0.5,0.8,0.8,1.1c0.1,0.2,0.2,0.3,0.3,0.4l35.6-36.7C228.7,74.3,228.1,73.9,227.5,73.6z M233.3,75.3
        l-37.4,38.6c0.4,0.5,0.9,0.9,1.3,1.3l39-40.2C235.4,75.2,234.4,75.3,233.3,75.3z M200,117.4c0.5,0.4,1.1,0.7,1.7,1l40.8-42.1v-2.7
        L200,117.4z M207,120.6L242.5,84v-2.7L205,120C205.6,120.2,206.3,120.4,207,120.6z M213.6,121.6l28.9-29.8V89l-31.4,32.4
        C211.9,121.5,212.7,121.5,213.6,121.6z M222.8,120.2l19.6-20.2v-2.7l-23.2,23.9C220.5,120.9,221.7,120.6,222.8,120.2z"/>
</g>

0 个答案:

没有答案