css一行文本如何两端对齐?

 

 

 

 

 

项目中领导要求右边的文字也要对齐;

实现方法

<h3>汇聚优秀远程人才,赋能企业高速发展</h3>
          <p>
            在这里,您可以免费招聘,灵活使用优秀远程人才,全程享受
            <br />专属客服,实时浏览远程人才在线工作状态以及进行高效管理
          </p>



h3 {
        font-size: 30px;
        font-weight: normal;
        color: #ffffff;
        text-align: justify;
        line-height: 1;
        margin: 20px 0;
        height: 30px;
        &::after {
          display: inline-block;
          content: "";
          width: 100%;
        }
      }

  h3中一定要添加行高和高度;不然会多出来一行;

参考链接

https://blog.csdn.net/weixin_38629529/article/details/106380242?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.pc_relevant_is_cache&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.pc_relevant_is_cache

posted @ 2020-11-05 15:22  墨染清浅  阅读(401)  评论(0)    收藏  举报