MUI-标题栏实现-样式复写效果

界面展示:
在这里插入图片描述
代码:
第一步,引入相关样式:(注意:还需要引入对应的iconfont2.ttf)

<link href="css/mui.css" rel="stylesheet" />
<link href="css/home.css" rel="stylesheet" />
<link href="css/common.css" rel="stylesheet" /> 
<link rel="stylesheet" href="css/iconfont2.css">

第二步:body内输入图标代码

<!-- 标题栏mheader -->
<header class="mui-bar mui-bar-nav top-bar">
	<!-- 语音搜索框minput -->
	<div class="mui-input-row mui-search">
		<input type="search" class="mui-input-speech mui-input-clear" placeholder="手机充值">
	</div>
	<!-- 添加 -->
	<a href="#">
		<span class="mui-icon icon iconfont icon-tianjia"></span>
	</a>
	<!-- 朋友 -->
	<a href="#">
		<span class="mui-icon icon iconfont icon-pengyou"></span>
	</a>
</header>

第三步:编辑home.css样式,调整顶栏组件格式

/* 将hmoe.html在浏览器中运行,接着使用F12查看控制其样式的类,并在此进行修改 */
/* 控制搜索框的宽度 */
.mui-search{
	width: 70%;
	float: left;
}
/* 控制搜索框的上下位置 */
.mui-bar input[type='search']{
	margin:8px 0;
}

/* 控制搜索框内搜索图标的颜色和位置 */
.mui-search .mui-placeholder .mui-icon{
	color:white!important;
	float:left;
	margin:2px 0;
}

/* 控制搜索框内"手机充值"的样式 */
.mui-search .mui-placeholder{
	text-align:left;
	color:white;
	font-size:12px;
	line-height: 44px;
}

/* 语音图标样式 */
.mui-icon-speech{
	font-size:20px!important;
	line-height: 25px;
	color:white!important;
}

/* 设置搜索框外的俩超链接图标样式 */
.top-bar a{
	width:35px!important;
	height:50px!important;
	float:right!important;
	line-height: 50px;
	margin-left:5px;
}
.top-bar a span{
	display: block!important;
	height: 50px!important;
	color:white!important;
	font-size:25px!important;
}

第四步:阿里巴巴矢量图标的样式控制iconfont2.css

@font-face {
  font-family: "iconfont"; /* Project id  */
  src: url('../fonts/iconfont2.ttf?t=1649660095085') format('truetype');
}
.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 添加 */
.icon-tianjia:before {
  content: "\e622";
}
/* 朋友 */
.icon-pengyou:before {
  content: "\e61a";
}

相关链接
1、MUI的简介
2、MUI的字体图标
3、MUI的事件处理
4、HbuilderX中新建MUI下的移动端App
5、H5+ Webview窗口对象
6、MUI-底栏实现-页面切换
7、MUI-标题栏实现-样式复写效果
8、MUI-栅格系统-实现元素排版
9、MUI-列表实现
10、MUI-列表实现2
11、MUI-轮播插件实现-UI组件
12、MUI-弹出菜单
13、MUI-页面刷新
14、MUI-新建子页面
15、MUI-页面之间传值(打开新的子页面)
16、HTML5+规范API-拍照功能
17、HTML5+规范API-系统相册获取功能
18、HTML5+规范API-地理位置获取
19、MUI-上拉刷新和下拉刷新
20、HTML5+规范API-扫码功能
21、HTML5+规范API-系统通讯录获取功能
22、Hbuilder无法完成应用程序云打包,一直报错需要打包校验
23、Hbuilder-应用程序打包
24、移动APP开发的三种常见模式
25、IOS系统测试APP时发现input内无法选中并输入值
26、MUI-购物车

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

郁慕斯-ing

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值