有HTML标记,如<img />,<input />和<button />,需要没有结束标记(</img>,</input>和</button>).描述这种类型标签的术语是什么?
我很迷惑.一位同事让我接触到标签结束的可能性/>,例如<br />仍然可以在HTML5中使用.我认为只能使用<br>风格.互联网上的所有"谈话"都是关于使用后者.
有人可以向我解释一下吗?这似乎非常令人困惑,而且记录不清.
这带来了另一个问题:HTML 5是否被认为是格式良好的XML?
这段代码在Firefox,Chrome和Edge中运行良好,但由于flex模型,它在IE11中无法正常工作.我该如何解决?
这就是它在Firefox中的样子
这就是它在IE11中的外观
body * {
box-sizing: border-box;
}
html {
height: 100%;
}
body {
min-height: 100%;
display: flex;
flex-flow: column;
margin: 0;
}
main {
flex: 1;
display: flex;
}
header,
footer {
background: #7092BF;
border: solid;
width: 100%;
}
section {
border: solid;
background: #9AD9EA;
flex: 1
}
aside {
border: solid;
width: 150px;
background: #3E48CC
}Run Code Online (Sandbox Code Playgroud)
<header>
<p>header
</header>
<main>
<aside>
<p>aside
<p>aside
</aside>
<section>
<p>content
<p>content
<p>content
<p>content
</section>
</main>
<footer>
<p>footer
<p>footer
</footer>Run Code Online (Sandbox Code Playgroud)
最近,一位朋友决定不在HTML中关闭他的标签或属性,因为它不是必需的,他将节省一些带宽和下载时间.我告诉他这是一个坏主意,并且"比对不起更安全",但是,我真的只能在这个问题上找到2个资源:
#1很好,但就像他说的那样,它们并不是真正的世界范例,这就是为什么我选择#2,但它们只是真正展示了<a>与大多数其他标签/节点不同的东西.
是否有其他资源或测试用例可以更好地引用属性并关闭标记?
阅读Oracle的Javadoc文档,我注意到作者没有关闭<p>标记.
/**
* The method used for creating the tree. Any structural
* modifications to the display of the Jtree should be done
* by overriding this method.
* <p>
* This method adds an anonymous TreeSelectionListener to
* the returned JTree. Upon receiving TreeSelectionEvents,
* this listener calls refresh with the selected node as a
* parameter.
*/
public JTree makeTree(AreaInfo ai){
}
Run Code Online (Sandbox Code Playgroud)
文件说明:
如果文档注释中有多个段落,请使用
<p>段落标记分隔段落,如图所示.
在Eclipse中,Javadoc格式正确,但仅仅因为它有效,它是否意味着它是"正确的"?
我想在 Angular 中格式化 XML 文件。我试过这个:
<div class="element-box">
<div class="details-wrapper">
<p><b class="label">Raw Request</b>
<pre>
{{apiattempt.raw_request | xmlBeautyfier }}
</pre>
</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
ERROR in : Template parse errors:
Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags ("
{{apiattempt.raw_request | xmlBeautyfier }}
</pre>
[ERROR ->]</p>
<p><b class="label">Raw Response</b>{{apiattempt.raw_response | xmlBeautyfier }}</p>
</div"):
Run Code Online (Sandbox Code Playgroud)
你知道我该如何解决这个问题吗?