效果图:
两个图片,两端对齐,右边的图片有闪动效果
.wxml
<!--PART ONE-->
<!--头部-->
<view class="header">
<view class="container hdcon">
<navigator open-type="switchTab" url="/pages/index/index" class="logo">
<image mode="heightFix" src="/images/logo.png"></image>
</navigator>
<view class="kefu">
<button class="btn" open-type="contact"></button>
<image mode="heightFix" src="/images/xiaoxi.png"></image>
</view>
</view>
</view>
.wxss
/**PART ONE头部布局**/
.header{width:750rpx;height:90rpx;}
.hdcon{display:flex;justify-content:space-between;align-items:center;height:100%;}/**两张图片放在一行**/
.hdcon navigator,.hdcon .kefu{height:50rpx;}
.hdcon image{height:100%;}
.kefu{position:relative;animation:dh linear 1s infinite;}
.kefu .btn{position:absolute;width:100%;height:100%;top:0;left:0;opacity:0;}
公共设置
app.wxss
.container{padding:0 26rpx;box-sizing:border-box;}/**左右两边距页面有间隔**/
@keyframes dh{
0%,50%,100%{opacity:1;}
25%{opacity:0;}
}/**右上角联系图标有闪动效果**/