我正在建立一個網站,除了 iPhone 上的鏈接外,移動設備中的所有樣式都可以正常作業。我已經嘗試了這個執行緒中的解決方案:
我試過這個CSS:
a[href^="tel"],
span[href^="tel"] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
還有這個CSS:
a[x-apple-data-detectors],
span[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
以上沒有對我有用。關于如何使用純CSS解決此問題以便樣式將繼承于我的所有網頁的任何建議?
更新解決方案
接受的答案將改變所有<span>/<a>元素的默認行為。相反,您應該在元素上使用id或class設定樣式。示例可能如下所示:
.lnd-header-button__text{
all: initial;
}
.lnd-header-button__text * {
all: unset;
}
uj5u.com熱心網友回復:
你可以通過媒體查詢來做到這一點
小心使用精確選擇器,因為使用 cssall會影響匹配選擇器的所有 css 屬性
@media only screen and (max-width: 600px) {
my-selector {
all: initial;
}
my-selector * {
all: unset
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/410701.html
標籤:
