位置: IT常识 - 正文

HTML渐变色(html渐变色背景)

编辑:rootadmin
HTML渐变色

推荐整理分享HTML渐变色(html渐变色背景),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:HTML渐变色字体,html渐变色背景,html渐变色代码,html渐变色代码,HTML渐变色,HTML渐变色,html渐变色背景代码,html渐变色代码,内容如对您有帮助,希望把文章链接给更多的朋友!

我们已经熟悉了如何创建一个盒子,如何去给盒子加上点颜色,加上点背景色让盒子达到我们想要的样子,但是又来了一个新的问题,如何再盒子中添加渐变色

 让我们的页面更加的美观呢

那么这里我们就要用到:background-image: -webkit-linear-gradient

在元素background属性里加入“background-image: radial-gradient(起始位置,形状,大小,颜色,颜色,颜色)”;

线性渐变:从一个方向到另一个方向到另一个方向的颜色的变化

标准模式的语法(不添加浏览器前缀):background:linear-gradient(direction,color-stop1,color-stop2)

HTML渐变色(html渐变色背景)

说明:direction默认值是to bottom,即从上往下

stop:颜色的分布位置,默认均匀分布(平均分布)

具体代码大家可以试试

background-image: -webkit-linear-gradient(left,rgb(0,208,212),rgb(158,255,164)) ;

说明:direction值不能加to,该值表示颜色从该方向开始渐变,与上面相反

stop:颜色的分布位置,默认均匀分布(平均分布)

渐变方向:前面实现了上下或左右渐变,接下来介绍对角线型渐变

1、to left \ to right \ to top(上下或左右渐变)

2、to left top \ to right bottom(对角线渐变)

3、渐变线角度的变化

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>去哪导航</title> <style> #box { width: 1800px; height: 40px; background-image: -webkit-linear-gradient(left,rgb(0,208,212),rgb(158,255,164)) ; font-size: 15px; text-align: center; } .box1 { width: 52px; height: 40px; float: left; } .box2 { width: 67px; height: 40px; float: left; } .box3 { width: 88.51px; height: 40px; float: left; } .box4 { width: 82px; height: 40px; float: left; } .box5 { width: 52px; height: 40px; float: left; } .box6 { width: 82px; height: 40px; float: left; } .box7 { width: 82px; height: 40px; float: left; } .box8 { width: 82px; height: 40px; float: left; } .box9 { width: 82px; height: 40px; float: left; } .box10 { width: 67px; height: 40px; float: left; } .box11 { width: 67px; height: 40px; float: left; } a { position: relative; display: block; height: 40px; line-height: 40px; font-size: 15px; color:white; text-decoration: none; font-family: "xiyangyang"; } .ww { font-family: "xiyangyang"; color: white; } @font-face { /* 字体起的名字 */ font-family: "xiyangyang"; /* 引入字体的路径 */ src: url(./字体/ZCOOLKuaiLe-Regular.ttf); }.box1:hover{ background-color:rgb(0,188,212) ;}.box2:hover{ background-color:rgb(0,188,212) ;}.box3:hover{ background-color:rgb(0,188,212) ;}.box4:hover{ background-color:rgb(0,188,212) ;}.box5:hover{ background-color:rgb(0,188,212) ;}.box6:hover{ background-color:rgb(0,188,212) ;}.box7:hover{ background-color:rgb(0,188,212) ;}.box8:hover{ background-color:rgb(0,188,212) ;}.box9:hover{ background-color:rgb(0,188,212) ;}.box10:hover{ background-color:rgb(0,188,212) ;}.box11:hover{ background-color:rgb(0,188,212) ;} </style></head><body> <div id="box"> <div class="box1"> <a href="#" class="ww">首页</a> </div> <div class="box2"> <a href="#" class="ww">机票</a> </div> <div class="box3"> <a href="#">酒店</a> </div> <div class="box4"> <a href="#">火车票</a> </div> <div class="box5"> <a href="#">度假</a> </div> <div class="box6"> <a href="#">团购</a> </div> <div class="box7"> <a href="#">门票</a> </div> <div class="box8"> <a href="#">当地人</a> </div> <div class="box9"> <a href="#">汽车票</a> </div> <div class="box10"> <a href="#">行程设计</a> </div> <div class="box11"> <a href="#">更多</a> </div> </div></body></html>
本文链接地址:https://www.jiuchutong.com/zhishi/298368.html 转载请保留说明!

上一篇:刷题日常计~JS③(刷题有什么作用)

下一篇:Javascript 基础知识学习(javascript入门基础)

  • 个人所得税清算怎么操作
  • 简易计税方法的销售额不包括其应纳税额
  • 关税是直接税还是间接税
  • 计提存货跌价准备的存货出售
  • 原材料不良品的处理流程
  • 给客户开增值税专用发票
  • 累计纳税工资是什么意思
  • 出口货物不能退税的原因
  • 代开的增值税专用发票应怎样填写?
  • 工业企业成本核算的一般程序包括下列的
  • 错账更正分录
  • 营改增后还有营业费用吗
  • 应收账款多记如何调账?
  • 现金流量表关注指标
  • 建设期利息对当年的借款如何计息?
  • 工程预付款需要监理审批吗
  • 个人出租仓库需交税吗
  • 通讯费税前扣除填报怎么填
  • 纳税的税种有哪些
  • 无法读取金税盘时间版本号是什么意思
  • 年金的缴费基数
  • 金银首饰零售消费税税收优惠
  • 项目工程分包账务
  • 公司购买汽车的购置税怎么做账
  • 上海中级会计报名入口
  • 利润表里的营业成本包括哪些
  • 递延收益的账务处理案例
  • 销售出库未开票怎么入账
  • 企业所得税汇算清缴扣除标准2023
  • 如何删除鸿蒙
  • osx无法安装怎么办
  • windows为什么从7开始
  • 民间非营利组织会计账务处理
  • 固态硬盘近年价格走势
  • php发送邮件的问题有哪些
  • 内格罗斯岛
  • php chr
  • 支付境外培训费要交税吗
  • 各种汇票
  • 卡比托丽娜·瓦西里耶娃
  • 批发商和零售商属于
  • 微信小程序最新咸鱼之王兑换
  • wget下载yum
  • 当月销售次月开票就按次月申报
  • javascript 箭头
  • python中exec执行如何获取返回值
  • discuz设置门户
  • 财务报表如何看
  • 印花税都有什么类目
  • 在途资金属于什么科目
  • 个体户需要税务报道不
  • 积分获取和消费的关系
  • mysql关闭连接命令
  • 纳税申报个税如何申报
  • 本月留抵增值税
  • 政府补贴专项资金补贴开发票
  • 餐饮行业纸巾入库流程
  • 企业设备维修
  • 小微企业减免附加税税率
  • 个人到税务局开普票要交多少税
  • 直接费用的定义
  • mysql多个group by
  • win7操作系统在哪儿卖
  • xp win10 打印机
  • windows蓝屏代码大全及解决方案
  • mac修改用户名称
  • win7怎么连接其他电脑共享的打印机
  • 如何设置访问共享文件夹
  • centos minio
  • windows10预览版是什么
  • linux就该这么些
  • linker command failed with exit code 1 (use -v to see invocation)
  • 移动端网页开发技术
  • js表格上移下移
  • 黑客dos攻击是什么攻击
  • 重写SimpleAdapter的getView以实现按钮点击响应
  • qrcode怎么生成
  • settimeout和setinterval在安卓机无效
  • javascript怎么编写
  • 消费税税收优惠的纳税筹划
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设