亚洲区国产区激情区无码区,国产成人mv视频在线观看,国产A毛片AAAAAA,亚洲精品国产首次亮相在线

SVG 陰影

在SVG中,為了顯示陰影效果,使用了 <feOffset>元素。要實(shí)現(xiàn)陰影效果,我們?nèi)VG圖形并將其在xy平面中移動(dòng)一點(diǎn),Internet Explorer和Safari不支持SVG濾鏡!

在線示例

下面實(shí)現(xiàn)一個(gè)紫色的背景陰影效果:

<svg height="250" width="250">
  <defs>
    <filter id="p1" x="0" y="0" width="200%" height="200%">
      <feOffset result="offOut" in="SourceGraphic" dx="20" dy="20"></feOffset>
      <feGaussianBlur result="blurOut" in="offOut" stdDeviation="10"></feGaussianBlur>
      <feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend>
    </filter>
  </defs>
  <rect width="90" height="90" stroke="blue" stroke-width="3" fill="purple" filter="url(#p1)" />
  </svg>
測(cè)試看看?/?

注意: Internet Explorer 9和更早版本不支持SVG篩選器。

運(yùn)行后效果如下:

用法解釋

  • <filter> 的id屬性定義了模式的唯一名稱。

  • <rect>元素的filter屬性用于將元素鏈接到“ p1”過(guò)濾器。

制作一個(gè)黑色的陰影

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <filter id="f1" x="0" y="0" width="200%" height="200%">
      <feOffset result="offOut" in="SourceAlpha" dx="20" dy="20" />
      <feGaussianBlur result="blurOut" in="offOut" stdDeviation="10" />
      <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
    </filter>
  </defs>
  <rect width="90" height="90" stroke="green" stroke-width="3" fill="yellow" filter="url(#f1)" />
</svg>
測(cè)試看看 ?/?

運(yùn)行后效果如下:

注意: Internet Explorer 9和更早版本不支持SVG篩選器。