What is the first line of code in the example below
下面例子中的第一行代码是什么
<p><p a>
I saw a youtuber writing the below code and it displayed a design in cssbattle challenge.I also tried it,it works.But I never saw it on any HTML tutorials before and I searched it on Google but it was showing resuts for paragraphs tags only which I already know.here is the link for the youtube video.
我看到一个YouTuber在写下面的代码,它显示了一个设计在csswar Challenges中。我也尝试了一下,它很管用。但我以前从未在任何HTML教程上看到过它,我在谷歌上搜索了它,但它只显示了我已经知道的段落标签的结果。这里是YouTube视频的链接。
<p><p a>
<style>
body{
background:#E6D9AC;
}
p{
width:91px;
height:30px;
padding:30px 0;
border:30px solid #BD6C27;
border-right:none;
background:#BD6C27;
position:absolute;
top:44;
left:125;
background-clip:content-box;
}
[a]{
background:#8F2D2B;
border-color:#8F2D2B;
left:155px;
top:74px;
rotate:-180deg;
background-clip:content-box;
}
</style>
I know about <p></p>
tags but this <p><p a>
tag, I didn't see it in HTML before. Do you know what it is called?
我知道
标记,但这个标记,我以前在HTML中没有见过。你知道它叫什么吗?
更多回答
Its just a p
tag with an attribute a
.
它只是一个带有属性a的p标记。
优秀答案推荐
<p>
is opening of a paragraph tag/element. <p a>
is just another opening of paragraph tag/element with an attribute a
. As you can see from the video, person selects elements with attribute a
using [a]
. It's used to just to differ paragraph elements. But this HTML is not valid since paragraph elements dont have a closing </p>
tag.
是段落标记/元素的开头。
只是具有属性a的段落标记/元素的另一个开头。正如您从视频中看到的,Person使用[a]选择具有属性a的元素。它通常只是用来区分段落元素。但此HTML无效,因为段落元素没有结束
标记。
更多回答
Just a note, in HTML (not XHTML), paragraph tags don't technically need a closing tag and is valid. See stackoverflow.com/a/8461004/978005
请注意,在HTML(不是XHTML)中,段落标记在技术上不需要结束标记,并且是有效的。参见Stackoverflow.com/a/8461004/978005
Omitting the p
close tag is perfectly valid. But the a
attribute is not.
省略p结束标记是完全有效的。但a属性并非如此。
我是一名优秀的程序员,十分优秀!