分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

【html+css3】在一张jpg图片上,显示多张透明的png图片

发布时间:2023-09-06 02:18责任编辑:苏小强关键词:png

1、需求:在一个div布局里面放置整张jpg图片,然后在jpg图片上显示三张水平展示的透明png图片,且png外层用a标签包含菜单

2、效果图:

3、上图,底层使用蓝色jpg图片,【首页】、【购物车】、【会员中心】三个图标都是透明的png黄色图片

4、上代码:html

<div style="height: 69px; ???position: relative; ???display: -webkit-box; ???display: -ms-flexbox; ???display: flex; ???-webkit-box-align: center; ???-ms-flex-align: center; ???align-items: center; ???background-repeat: no-repeat; ???background-position: center; ???background-size: 100%; ???background: url(http://weixin.***.com/addons/ewei_shopping/template/mobile/images/Q_04.jpg);"> ???????<a href="{php echo $this->createMobileUrl(‘nightpay‘)}"><img src="http://weixin.***.com/addons/ewei_shopping/template/mobile/images/Q_05.png" height="60px"></a> ???????<a href="{php echo $this->createMobileUrl(‘MycartNight‘)}"><img src="http://weixin.***.com/addons/ewei_shopping/template/mobile/images/Q_07.png" height="60px"></a> ???????<a href="{php echo $this->createMobileUrl(‘User_center‘)}"><img src="http://weixin.***.com/addons/ewei_shopping/template/mobile/images/Q_09.png" height="60px"></a> ???</div>

css:

a{ ??color: #4f4f4f; ???text-decoration: none; ???display: block; ???flex: 1; ???width: 100%; ???height: 100%; ???text-align: center; ?}

5、记录一点,多学习一点,以后总会用到,自信从点滴开始。

【html+css3】在一张jpg图片上,显示多张透明的png图片

原文地址:https://www.cnblogs.com/xuzhengzong/p/9797825.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved