簡體   English   中英

如何模糊按鈕的輪廓?

[英]How to blur the outline of button?

我試圖在不模糊內部圖像的情況下模糊按鈕的輪廓。 模糊濾鏡僅適用於整個圖像,但我只希望藍色輪廓模糊。 基本上應用 filter: blur(4px) 但只在輪廓上

 button:focus {
  outline-color: #054EBA;
  outline-width: 2px;
  outline-offset: 5px;
}

我有什么我想要什么

您需要將模糊效果發送到另一個容器,它可以是偽容器。

例子

 button { position: relative; margin: 3em; padding: 0em 0.35em; color: white; background: #000; border-radius: 50%; border: none; font-size:2em; } button:focus:after { content: ''; position: absolute; top: -10px; bottom: -10px; left: -10px; right: -10px; pointer-events: none; border: solid #054eba 2px; filter: blur(2px); }
 <button>?</button>

Select 只有按鈕而不是里面的圖像

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM