Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 我不知道如何附加方括号中的属性名_Html_Css - Fatal编程技术网

Html 我不知道如何附加方括号中的属性名

Html 我不知道如何附加方括号中的属性名,html,css,Html,Css,我不知道怎么用这个。我用不同的方法试过,但都不管用 abbr[title] { border-bottom: 4px dotted green } 以下是有关如何完成附加和属性名称的文档: 下面是使用这些属性选择器的演示: HTML: 非常有帮助!谢谢。这是有效的css,它将相应地为所有元素设置样式,前提是它们指定了title属性。这就是你的目标吗?请你能提供你的html吗? <div class="hello-example"> <a href="http://e

我不知道怎么用这个。我用不同的方法试过,但都不管用

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

以下是有关如何完成附加和属性名称的文档:

下面是使用这些属性选择器的演示:

HTML:


非常有帮助!谢谢。这是有效的css,它将相应地为所有元素设置样式,前提是它们指定了title属性。这就是你的目标吗?请你能提供你的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>
/* 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;}