<body>
<div class="example example1"><div class="inner">方法一</div></div>
<div class="example example2"><div class="inner">方法二</div></div>
<div class="example example3"><div class="inner">方法三</div></div>
<div class="example example4"><div class="inner">方法四</div></div>
</body>
<style type="text/css">
.example {
position: relative;
width: 200px;
height: 200px;
background: #FF5555;
margin: 20px;
float: left;
}
.example1 .inner {
position: absolute;
width: 100px;
height: 100px;
background: #fff;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.example2 .inner {
position: absolute;
width: 100px;
height: 100px;
background: #fff;
top: 50%;
left: 50%;
margin-top: -50px;
margin-left: -50px;
}
.example3 .inner {
position: absolute;
width: 100px;
height: 100px;
background: #fff;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
.example4 {
display: flex;
justify-content: center;
align-items: center;
}
.example4 .inner {
width: 100px;
height: 100px;
background: #fff;
}
</style>

**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。