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