当前位置:网站首页>微信小程序03-文字一左一右显示,行内块元素居中
微信小程序03-文字一左一右显示,行内块元素居中
2022-07-01 15:09:00 【蹦跶哒的王小哲】
效果展示

实现程
WXML 文件:
<view class="doctor">
<view class="doctor-tit">
<view class="left-tit">医生推荐</view>
<view class="right-tit">查看更多></view>
</view>
<view class="doctor-list">
<view class="list">
<image class="doctor-pic" src="../../images/center.png"></image>
<view class="doctor-name">赵医师</view>
</view>
<view class="list">
<image class="doctor-pic" src="../../images/center.png"></image>
<view class="doctor-name">陈医师</view>
</view>
<view class="list">
<image class="doctor-pic" src="../../images/center.png"></image>
<view class="doctor-name">刘医师</view>
</view>
</view>
</view>WXSS样式:
01 文字左右显示
display: flex;
justify-content: space-between;
02 盒子居中显示
display : flex;
justify-content : space-around;
/* 医生推荐 */
.doctor-tit {
height: 20px;
padding: 15px;
display: flex;
justify-content: space-between;
}
.left-tit {
font-size: 14pt;
text-align: justify;
}
.right-tit {
margin-top: 5px;
font-size: 10pt;
color: #b2b2b2;
}
.doctor-list {
display : flex;
width: 100%;
background-color: #fff;
justify-content : space-around;
}
.list {
width: 30%;
height: 150px;
border: 1px solid red;
text-align: center;
}
.list .doctor-pic {
width: 100%;
height: 120px;
}
.list .doctor-name {
font-size: 12pt;
}边栏推荐
- Rearrangement of overloaded operators
- 22-06-26周总结
- Ensure production safety! Guangzhou requires hazardous chemical enterprises to "not produce in an unsafe way, and keep constant communication"
- 智能运维实战:银行业务流程及单笔交易追踪
- MySQL审计插件介绍
- JVM第一话 -- JVM入门详解以及运行时数据区分析
- One of the first steps to redis
- Configuration of ZABBIX API and PHP
- openssl客户端编程:一个不起眼的函数导致的SSL会话失败问题
- In hot summer, please put away this safe gas use guide!
猜你喜欢

写在Doris毕业后的第一天

首届技术播客月开播在即

音乐播放器开发实例(可毕设)
![After twists and turns, I finally found the method of SRC vulnerability mining [recommended collection]](/img/ac/ab6053e6ea449beedf434d4cf07dbb.png)
After twists and turns, I finally found the method of SRC vulnerability mining [recommended collection]

JS中箭头函数和普通函数的区别

JVM第二话 -- JVM内存模型以及垃圾回收

The difference between arrow function and ordinary function in JS

Internet hospital system source code hospital applet source code smart hospital source code online consultation system source code

Music player development example (can be set up)

微信公众号订阅消息 wx-open-subscribe 的实现及闭坑指南
随机推荐
It's suitable for people who don't have eloquence. The benefits of joining the China Video partner program are really delicious. One video gets 3 benefits
Introduction to MySQL audit plug-in
常见健身器材EN ISO 20957认证标准有哪些
APK签名原理
关于重载运算符的再整理
What if you are always bullied because you are too honest in the workplace?
NPDP能给产品经理带来什么价值?你都知道了吗?
Opencv learning note 4 -- bank card number recognition
Basic use process of cmake
网速、宽带、带宽、流量三者之间的关系是什么?
Ubuntu 14.04下搭建MySQL主从服务器
What is the relationship between network speed, broadband, bandwidth and traffic?
Storage form of in-depth analysis data in memory
Error-tf.function-decorated function tried to create variables on non-first call
定了!2022海南二级造价工程师考试时间确定!报名通道已开启!
Error-tf. function-decorated function tried to create variables on non-first call
[lock] redis lock handles concurrency atomicity
[leetcode] 16. The sum of the nearest three numbers
The markdown editor uses basic syntax
opencv学习笔记六--图像拼接