其他分享
首页 > 其他分享> > 左图有文字的一些CSS样式

左图有文字的一些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.icode9.com/i/ll/?i=20190712132843429.png?,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3F1aG9uZ3FpYW5n,size_16,color_FFFFFF,t_70

标签:flex,right,样式,左图,height,10px,font,CSS,size
来源: https://blog.csdn.net/quhongqiang/article/details/95611147