首页 > 解决方案 > 将图像置于 SVG 填充之前

问题描述

我有一个 SVG 元素, dining-table. 我想在dining-table.

.dining-table rect {
  width: 50px;
  height: 50px;
  fill: white;
  stroke: #0A7A74;
  stroke-width: 2px;
}
<svg width="500px" height="500px">
  <g class="dining-table">
    <image xlink:href="http://kommis.net/wp-content/uploads/2018/07/410147-200.png" x="0" y="0" height="50px" width="50px"/>
      <rect>
      </rect> 
   </g>
</svg>

这是 JSfiddle 链接:https ://jsfiddle.net/ye0atc3p/7/

标签: htmlcsssvg

解决方案


推荐阅读