左图有文字的一些CSS样式

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>左图有文字的一些样式</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    .box {
      padding: 0 15px;
      height: 70px;
      background: #ccc;
      display: flex;
      position: relative;
    }
    .box .flx {
      position: absolute;
      right: 15px;
      height: 70px;
      line-height: 70px;
    }
    .box .img {
      width: 50px;
      height: 50px;
      margin: 10px 10px 10px 0;
    }
    .box .right {
      flex: 1;
      flex-direction: column;
      display: flex;
      justify-content: center;
    }
    .box .p {
      height: 100%;
      line-height: 35px;
    }
    .box .p2 {
      font-size: 14px;
    }

    /* end------------------------------------- */
    .box2 {
      padding: 0 15px;
      height: 70px;
      background: #ccc;
      display: flex;
      margin-top: 20px;
    }
    .box2 .img {
      width: 50px;
      height: 50px;
      margin: 10px 10px 10px 0;
    }
    .box2 .right {
      flex: 1;
      flex-direction: column;
      display: flex;
      justify-content: center;
    }
    .box2 .p {
      height: 100%;
      line-height: 35px;
    }
    .box2 .p2 {
      font-size: 14px;
    }
    .box2 .bottom {
      font-size: 13px;
    }
    .box2 .bottom .time{
      float: right;
    }
    /* end------------------------------------- */
    .box3 {
      padding: 0 15px;
      height: 70px;
      background: #ccc;
      display: flex;
      margin-top: 20px;
      font-size: 15px;
    }
    .box3 .img {
      width: 50px;
      height: 50px;
      margin: 10px 10px 10px 0;
    }
    .box3 .right {
      flex: 1;
      flex-direction: column;
      display: flex;
      justify-content: center;
    }
    .box3 .p2 {
      font-size: 14px;
    }
    .box3 .bottom {
      font-size: 13px;
      color: #333333;
    }
    .box3 .bottom .time{
      float: right;
    }
    .box3 .bottom .price{
      color: red;
    }
    /* end------------------------------------- */
    .box4 {
      padding: 0 15px;
      height: 70px;
      background: #ccc;
      display: flex;
      margin-top: 20px;
      font-size: 15px;
    }
    .box4 .img {
      width: 50px;
      height: 50px;
      margin: 10px 10px 10px 0;
    }
    .box4 .right {
      flex: 1;
      flex-direction: column;
      display: flex;
      justify-content: center;
    }
    .box4 .p2 {
      font-size: 14px;
    }
    .box4 .bottom {
      font-size: 13px;
      color: #333333;
    }
    .box4 .bottom .time{
      float: right;
    }
    .box4 .bottom .price{
      color: red;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="flx">></div>
    <img class="img" src="https://avatars1.githubusercontent.com/u/19720683?s=460&v=4" alt="tu" />
    <div class="right">
      <p class="p">古北-畅游记</p>
      <p class="p p2">这是第二段段文字标题</p>
    </div>
  </div>
  <div class="box2">
    <img class="img" src="https://avatars1.githubusercontent.com/u/19720683?s=460&v=4" alt="tu" />
    <div class="right">
      <p class="p">古北-畅游记</p>
      <div class="p bottom">
        <span class="name">古北水镇</span>
        <span class="time">2019-02-23</span>
      </div>
    </div>
  </div>
  <div class="box3">
    <img class="img" src="https://avatars1.githubusercontent.com/u/19720683?s=460&v=4" alt="tu" />
    <div class="right">
      <p class="p">古北-畅游记</p>
      <div class="p bottom">
        <span>名胜古迹</span>
        <span>4A景区</span>
        <span class="price">¥20</span>
      </div>
      <div class="p bottom">
        <span class="name">古北水镇</span>
        <span class="time">2019-02-23</span>
      </div>
    </div>
  </div>
  <div class="box4">
    <img class="img" src="https://avatars1.githubusercontent.com/u/19720683?s=460&v=4" alt="tu" />
    <div class="right">
      <p class="p">古北-畅游记<span style="float: right">某些文字</span></p>
      <div class="p bottom">
        <span>名胜古迹</span>
        <span>4A景区</span>
        <span class="price">¥20</span>
      </div>
      <div class="p bottom">
        <span class="name">古北水镇</span>
        <span class="time">2019-02-23</span>
      </div>
    </div>
  </div>
</body>
</html>

https://www.jb51.cc/res/2022/10-08/03/f82c5ed2725c17c86a51fe8f5b1b7b4a.jpg

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...