按钮美化,变化显示效果
第一种:用css来做
多的不说,效果和代码如下:
1.效果
状态 | 显示效果 |
默认状态 | |
鼠标在时 |
2.代码
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> 5 6 7 <style type="text/css"> 8 #wrap .add-app{ 9 display:block; 10 width:100px; 11 height:28px; 12 line-height:28px; 13 text-align:center; 14 background:#962CC7; 15 color:white; 16 border-radius:4px; 17 text-decoration: none; 18 } 19 #wrap .add-app:visited{20 color:white; 21 } 22 #wrap .add-app:hover{23 background:#00A9F0; 24 color:white; 25 text-decoration: none; 26 } 27 </style> 28 29 30 </head> 31 </head> 32 <body> 33 <div id="wrap"> 34 <a href="#" class="add-app">返回</a> 35 36 </div> 37 </body> 38 </html>
View Code
第二种:用css结合事件来做
1.效果
略
2.代码
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> 5 6 7 <style type="text/css"> 8 .input_load{ 9 border:none; 10 width:84px; 11 height:35px; 12 padding:0 2px 4px 0; 13 *padding-bottom:0; 14 background:#0672AD; 15 font:16px/35px "微软雅黑"; 16 color:#fff; 17 cursor:pointer; 18 border-radius:8px; 19 } 20 .input_on{21 border:none; 22 width:84px; 23 height:35px; 24 padding:0 2px 4px 0; 25 *padding-bottom:0; 26 background:red; 27 font:16px/35px "微软雅黑"; 28 color:#fff; 29 cursor:pointer; 30 border-radius:8px; 31 } 32 .input_out{33 border:none; 34 width:84px; 35 height:35px; 36 padding:0 2px 4px 0; 37 *padding-bottom:0; 38 background:#0672AD; 39 font:16px/35px "微软雅黑"; 40 color:#fff; 41 cursor:pointer; 42 border-radius:8px; 43 } 44 </style> 45 46 47 </head> 48 </head> 49 <body> 50 <input type="submit" value="保存添加" class="input_load" onmousemove="this.className='input_on'" onmouseout="this.className='input_out'" /> 51 </body> 52 </html>
View Code
有何指教,请至信邮箱:1465567571@qq.com
转载于:https://www.cnblogs.com/andy9468/p/4278554.html
按钮美化,变化显示效果相关推荐
- iOS 9应用开发教程之使用代码添加按钮美化按钮
iOS 9应用开发教程之使用代码添加按钮美化按钮 丰富的用户界面 在iOS9中提供了很多的控件以及视图来丰富用户界面,对于这些视图以及控件我们在上一章中做了简单的介绍.本章我们将详细讲解这些视图. i ...
- java swing 禁用鼠标事件_Java学习笔记:swing中树控件,设置树节点的图标,按钮美化,鼠标事件,禁止鼠标双击...
树控件: JTree:声明树控件 声明树的节点: DefaultMutableTreeNode dd=new DefaultMutableTreeNode("传入树节点名称"); ...
- 自定义按钮动态变化_新闻价值的变化定义
自定义按钮动态变化 I read Bari Weiss' resignation letter from the New York Times with some perplexity. In par ...
- android多个按钮美化,Android按钮美化样式的实现代码
话不多说,上运行效果图 在drawable文件夹下 新建button_drawable.xml android:shape="rectangle"> android:bott ...
- android按钮美化(入门)
android按钮美化 话不多说,上运行效果图 在drawable文件夹下 新建button_drawable.xml <?xml version="1.0" encodin ...
- h5 数字变化_基于JS实现数字动态变化显示效果附源码
先给大家展示下效果,感觉不错,可以参考实现代码,文末附有源码哦. 1.目标 以液晶电子表样式,动态变化的在指定元素内显示数字. 目标关键词:动态变化(定时器),指定元素(DOM元素ID),数字(num ...
- 【Pyqt5】进度条QProgressBar的使用/多线程更新/按钮美化/图片编码/开机自启动
前言 诚如标题所见,我在使用Pyqt5进行开发时,先后遇到了上面几个问题.本篇博客就用来记录遇到问题/解决问题的过程,希望能给遇到相同问题的读者一些参考. 项目背景 我的项目是构建一个可视化的交互界面 ...
- html的文本框、按钮美化
input框和按钮美化 input框美化 按钮美化 有时候一些后端人员,想写一个简单的表单验证的时候,前端美化问题是一个非常头疼的问题,我们直接用html的input标签和按钮会非常丑,这时候我们可以 ...
- css input[type=file] 样式美化,input上传按钮美化
思路: 原文出处:http://www.haorooms.com/post/css_input_uploadmh input file上传按钮的美化思路是,先把之前的按钮透明度opacity设置为0, ...
最新文章
- Spring Initializr 构建Spring Boot/Cloud工程
- Win10 安装程序错误2502/2503 拒绝访问 解决
- 【Java 虚拟机原理】Class 字节码二进制文件分析 七 ( 局部变量表分析 )
- 深度学习核心技术精讲100篇(六)-keras 实战系列之知识蒸馏(Knowledge Distilling)
- Intellij IDEA中 Debug 用法
- 程序员初试和复试_程序员因肌肉发达面试被质疑能力,网友:这做程序员有啥关系呢?...
- 求一个向量变换为另一个向量的矩阵_OpenGL里旋转等变换矩阵为什么是4x4的矩阵...
- 【微信开发】-- 发送模板消息
- (转)Maven仓库——私服介绍
- 魔界/指环王三部曲(加长版)在线观看免费bt下载
- 实现网站流量统计(监控网站流量)
- 台湾大学开放式课程C语言,国立台湾大学-台大开放式课程.doc
- Java解析Lrc歌词
- ORA -09925
- Vertica—操作汇总
- 文件下载被浏览器默认打开解决方法
- 牛客练习赛52.Galahad(树状数组维护区间不相同数的和)
- Eclipse中如何查看使用的JDK版本?
- BERT与ERNIE
- 课后作业——Day11