Attribute Selectors in CSS: Quotation Mark Conundrum
When crafting CSS attribute selectors to match elements' attributes, such as a[rel="nofollow"], a persistent dilemma arises: whether or not to include quotation標記。
引號問題CSS規範指示屬性選擇器語法的指南,包括圍繞屬性值的引號放置。如果屬性值僅由字母數字字符組成,則需要。但是,存在異常: 值包含whitespace(例如,a [title = my page])
值,其中包含特殊字符的字符(例如,Asterisks,parenhes,parenhess,earlheses等),with。 a [class =無效的class])a [rel =“ nofollow”]
a [href^=“ http:// http://”] 認為包括它們的最佳實踐以確保一致性並防止潛在的衝突。 資源
(答案中提供的鏈接)
免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3