</p>仅在XHTML中需要,但在HTML中不需要.有时你必须关闭它,例如当您将段落左/右/中心对齐时.
混合使用</p>如下所示是一个坏主意?请注意,</p>第1段和第3段中没有结束标记.
<h1>My article</h1>
<p>This is my 1st paragraph.
<p class="align=right">This is my 2nd paragraph</p>
<p>This is my 3rd paragraph.
Run Code Online (Sandbox Code Playgroud)
我不想关闭P标签的原因:
我的flex容器:
.back_pattern {
display: flex;
display: -ms-flexbox;
-ms-flex-pack: center;
flex-direction: column;
align-content: center;
justify-content: center;
min-height: 100vh;
width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
在其他浏览器上一切正常.
ie11:http://take.ms/68dHo ;
chrome:http://take.ms/JhcEH有
什么问题?
我使用Chris 的 Coyer 方法使页脚粘在页面底部。
HTML
<div class="container">
<div class="content-box">
<div class="image-box">
<img src="https://i.stack.imgur.com/XIQ2T.jpg">
</div>
</div>
<div class="bottom-box">Bottom</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.container {
display: flex;
flex-direction: column;
height: 100vh; /* Avoid the IE 10-11 `min-height` bug. */
}
.bottom-box {
flex-shrink: 0; /* Prevent Chrome, Opera, and Safari from letting these items shrink to smaller than their content's default minimum size. */
background: #069;
color: #fff;
line-height: 3;
}
.content-box {
flex: 1 0 auto; /* Prevent Chrome, Opera, and …Run Code Online (Sandbox Code Playgroud)