選單
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

SVG 模糊效果


SVG <feGaussianBlur>

The <feGaussianBlur> filter is used to create blur effects

Sorry, your browser does not support inline SVG.

這是 SVG 程式碼

示例

<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter id="f1" x="0" y="0" xmlns="http://www.w3.org/2000/svg">
      <feGaussianBlur in="SourceGraphic" stdDeviation="15" />
    </filter>
  </defs>
  <rect width="90" height="90" fill="yellow" filter="url(#f1)" />
</svg>
自己動手試一試 »

程式碼解釋

  • 元素 <filter>id 屬性定義了濾鏡的唯一名稱。
  • The blur effect is defined with the <feGaussianBlur> element
  • The in="SourceGraphic" part defines that the effect is created for the entire element
  • The stdDeviation attribute defines the amount of the blur
  • <rect> 元素的 filter 屬性將元素指向 "f1" 濾鏡。

SVG <feGaussianBlur>

The stdDeviation attribute defines the amount of the blur. A higher value results in a more blurry image

Sorry, your browser does not support inline SVG.

這是 SVG 程式碼

示例

<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter id="f2" x="0" y="0" xmlns="http://www.w3.org/2000/svg">
      <feGaussianBlur in="SourceGraphic" stdDeviation="55" />
    </filter>
  </defs>
  <rect width="90" height="90" fill="yellow" filter="url(#f2)" />
</svg>
自己動手試一試 »

×

聯絡銷售

如果您想將 W3Schools 服務用於教育機構、團隊或企業,請傳送電子郵件給我們
sales@w3schools.com

報告錯誤

如果您想報告錯誤,或想提出建議,請傳送電子郵件給我們
help@w3schools.com

W3Schools 經過最佳化,旨在方便學習和培訓。示例可能經過簡化,以提高閱讀和學習體驗。教程、參考資料和示例會不斷審查,以避免錯誤,但我們無法保證所有內容的完全正確性。使用 W3Schools 即表示您已閱讀並接受我們的使用條款Cookie 和隱私政策

版權所有 1999-2024 Refsnes Data。保留所有權利。W3Schools 由 W3.CSS 提供支援