flex justify-content margin text-align 居中测试

<!DOCTYPE HTML>
<html>
    <head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <style>
.box {
height: 200px;
width: 400px;
background-color: green;/*    text-align:center;  */
}
.test {
/* margin:0 auto;  */
height: 40px;
width: 40px;
background-color: orange;
}
.box2 {
border: 1px solid;
height: 200px;
width: 400px;
background-color: green;
display: flex;
justify-content: flex-end;
;
}
.test2 {
height: 40px;
width: 40px;
background-color: orange;
}
</style>
    </head>
    <body>
<div class="box">
      <div class="test"></div>
      <p style="width:120px;">测试数据</p>
      <ul style="width:100%;">
    测试数据
  </ul>
      <img src="../images/look.jpg" alt="pic"/> </div>
<div class="box2"> <img src="../images/look.jpg" alt="pic"/> </div>
<div class="test2"></div>
<p style="width:120px;">测试数据</p>
<ul style="width:100px;">
      测试数据
    </ul>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/liu709127859/article/details/80190967