gpt4 book ai didi

html - 我不知道附加一个用方括号括起来的属性名

转载 作者:太空宇宙 更新时间:2023-11-03 18:00:22 26 4
gpt4 key购买 nike

我不知道如何使用它。我尝试过使用不同的方法,但没有任何效果。

abbr[title] { border-bottom: 4px dotted green }

最佳答案

这里是关于如何完成追加和属性名称的文档: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

这是一个使用这些属性选择器的演示:http://jsfiddle.net/id_0t/q0g0jako/

HTML:

<div class="hello-example">
<a href="http://example.com">English:</a>
<span lang="en-us en-gb en-au en-nz">Hello World!</span>
</div>
<div class="hello-example">
<a href="#portuguese">Portuguese:</a>
<span lang="pt">Olá Mundo!</span>
</div>
<div class="hello-example">
<a href="http://example.cn">Chinese (Simplified):</a>
<span lang="zh-CN">世界您好!</span>
</div>
<div class="hello-example">
<a href="http://example.cn">Chinese (Traditional):</a>
<span lang="zh-TW">世界您好!</span>
</div>

CSS:

/* All spans with a "lang" attribute are bold */
span[lang] {font-weight:bold;}

/* All spans in Portuguese are green */
span[lang="pt"] {color:green;}

/* All spans in US English are blue */
span[lang~="en-us"] {color: blue;}

/* Any span in Chinese is red, matches simplified (zh-CN) or traditional (zh-TW) */
span[lang|="zh"] {color: red;}

/* All internal links have a gold background */
a[href^="#"] {background-color:gold}

/* All links to urls ending in ".cn" are red */
a[href$=".cn"] {color: red;}

/* All links to with "example" in the url have a grey background */
a[href*="example"] {background-color: #CCCCCC;}

关于html - 我不知道附加一个用方括号括起来的属性名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25574955/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com