CSS布局常用代码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lp15203883326/article/details/83783634

  想要的样式:

.tel_li{
    display: flex;
    justify-content: left;
    align-items: center;
    height:50px;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
}

.tel_img {
    width: 23px;
    margin-right: 10px;
}

.tel_go{
    width: 11px;
    margin-left: auto;
}
.tel_font{
    font-size:15px;
    font-family:PingFangSC-Regular;
    color: #666666;
}

html 


            <li class="tel_li" onclick="CallMe(${hospital.hospitalTel})">
                <img class="tel_img" src="http://images0.zaijiawan.com/wechat/hospitalGroupList/tel_icon.png@!ori">
                <p class="tel_font">${hospital.hospitalTel}</p>
                <img class="tel_go" src="http://images0.zaijiawan.com/wechat/hospital/go_gray.png@!ori">
            </li>
  

顺便贴上一键打电话的代码~

   function CallMe(phoneNum) {
        window.location.href="tel:"+phoneNum;
    }

最核心的代码就是:

    display: flex;
    justify-content: left;
    align-items: center;

猜你喜欢

转载自blog.csdn.net/lp15203883326/article/details/83783634
今日推荐