簡體   English   中英

屬性 'border:none' 在 Safari 瀏覽器中無法正常工作

[英]property 'border:none' doesn't work well in Safari Browser

我在 safari 瀏覽器中應用屬性“border:none”時遇到了一些問題。 我嘗試將名為“profile-label”的 css class 具有屬性“border:none”應用到標簽“label”中,如下面的代碼:

 .profile-label { border: none; cursor: pointer; }
 <label for="photo" class="profile-label" type="submit"> <img src="https://picsum.photos/536/354" alt="Foto" width="50" height="50" class="profile-photo" /> <input type="file" id="photo" hidden name="ProfileImage"/> </label>

該屬性在 safari(邊框:無)中無法正常工作,但在所有其他瀏覽器中都可以正常工作。 有誰知道為什么?

safari 瀏覽器中帶邊框的圖像:

在此處輸入圖像描述

您可能想嘗試將以下屬性添加到 CSS:

outline: none;

不過,我不確定我能回答為什么會這樣。

它顯示了一個按鈕邊框,因為 label 使用 type="submit" 屬性包裝圖像。

Safari 正在添加所有按鈕的默認樣式。

嘗試添加-webkit-appearance: none ; 到您的 label 樣式

或者去掉屬性type=submit

在此處輸入圖像描述

暫無
暫無

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

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