我试图垂直居中我的标签内容,但是当我添加CSS样式时display:inline-flex,水平文本对齐消失.
如何为每个标签创建文本对齐x和y?
* { box-sizing: border-box; }
#leftFrame {
background-color: green;
position: absolute;
left: 0;
right: 60%;
top: 0;
bottom: 0;
}
#leftFrame #tabs {
background-color: red;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 25%;
}
#leftFrame #tabs div {
border: 2px solid black;
position: static;
float: left;
width: 50%;
height: 100%;
text-align: center;
display: inline-flex;
align-items: center;
}Run Code Online (Sandbox Code Playgroud)
<div id=leftFrame>
<div id=tabs>
<div>first</div>
<div>second</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
根据标题; 是否可以在有效的HTML中嵌套注释?看下面的例子......
<p>some text</p>
<!-- comment 1
<p>commented out html</p>
<!-- comment 2
// are nested html comment allowed?
end of comment 2 -->
<p>more commented out html</p>
end of comment 1 -->
<p>some more text</p>
Run Code Online (Sandbox Code Playgroud)
看来不是,有人知道如何让嵌套注释工作吗?
有这么好的理由吗?Lame问题,但我只是想知道是否有原因.