PC端和APP端css样式重置

PC:

 html{font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%

}
html, body, div, object, iframe, applet, object, h1, h2, h3, h4, h5, h6, p, blockquote, pre, address, dl, dt, dd, ol, ul, li, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, menu, nav, output, ruby, section, summary, time, mark, audio, video, progress {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: baseline
}

li {
  list-style: none
}

article, aside, details, figcaption, figure, footer, header, main, menu, nav, section, summary {
  display: block
}

audio, canvas, progress, video {
  display: inline-block
}

audio:not([controls]) {
  display: none;
  height: 0
}

[hidden], template {
  display: none
}

a {
  background-color: transparent;
  text-decoration: none
}

a:active, a:hover {
  outline: 0
}

abbr[title] {
  border-bottom: 1px dotted
}

b, strong {
  font-weight: bold
}

dfn {
  font-style: italic
}

h1 {
  font-size: 2em;
  margin: .67em 0
}

mark {
  background: #ff0;
  color: #000
}

small {
  font-size: 80%
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline
}

sup {
  top: -0.5em
}

sub {
  bottom: -0.25em
}

img {
  border: 0
}

svg:not(:root) {
  overflow: hidden
}

figure {
  margin: 1em 40px
}

hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: 0
}

pre {
  overflow: auto
}

code, kbd, pre, samp {
  font-family: monospace, monospace;
  font-size: 1em
}

button, input, optgroup, select, textarea {
  color: inherit;
  font: inherit;
  margin: 0;
  outline: none;
  line-height: normal
}

button {
  overflow: visible
}

button, select {
  text-transform: none
}

button, html input[type="button"], input[type="reset"], input[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer
}

button[disabled], html input[disabled] {
  cursor: default
}

button::-moz-focus-inner, input::-moz-focus-inner {
  border: 0;
  padding: 0
}

input {
  line-height: normal
}

input[type="checkbox"], input[type="radio"] {
  box-sizing: border-box;
  padding: 0
}

input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button {
  height: auto
}

input[type="search"] {
  -webkit-appearance: textfield;
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  box-sizing: content-box
}

input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none
}

fieldset {
  border: 1px solid silver;
  margin: 0 2px;
  padding: .35em .625em .75em
}

legend {
  border: 0;
  padding: 0
}

textarea {
  overflow: auto
}

optgroup {
  font-weight: bold
}

table {
  border-collapse: collapse;
  border-spacing: 0
}

td, th {
  padding: 0
}

APP端:

/*移动端常见css样式重置*/
html {
  font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%
}

html, body {
  -webkit-user-select: none;
  user-select: none;
}

html, body, div, object, iframe, applet,
object, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, address, dl, dt, dd, ol, ul, li, table,
caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, figure,
figcaption, footer, header, menu, nav, output, ruby,
section, summary, time, mark, audio, video, progress {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: baseline
}

a {
  text-decoration: none;
  -webkit-touch-callout: none;
  background-color: transparent
}

li {
  list-style: none
}

article, aside, details, figcaption, figure,
footer, header, main, menu, nav,
section, summary {
  display: block
}

audio, canvas, progress, video {
  display: inline-block
}

audio:not([controls]) {
  display: none;
  height: 0
}

[hidden], template {
  display: none
}

a:active, a:hover {
  outline: 0
}

abbr[title] {
  border-bottom: 1px dotted
}

b, strong {
  font-weight: bold
}

dfn {
  font-style: italic
}

h1 {
  font-size: 8.533vw;
  margin: 2.859vw 0
}

small {
  font-size: 80%
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline
}

sup {
  top: -2.13vw;
  bottom: -2.13vw
}

sub {
}

img {
  border: 0;
  -webkit-touch-callout: none;
}

svg:not(:root) {
  overflow: hidden
}

figure {
  margin: 4.2667vw 10.667vw
}

hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: 0
}

pre {
  overflow: auto
}

code, kbd, pre, samp {
  font-family: monospace, monospace;
  font-size: 4.267vw
}

a, button, input, optgroup, select, textarea {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

button, input, optgroup, select, textarea {
  color: inherit;
  font: inherit;
  margin: 0;
  -webkit-appearance: none;
  outline: none;
  line-height: normal
}

button {
  overflow: visible
}

button, select {
  text-transform: none
}

button, html input[type="button"], input[type="reset"], input[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer
}

button[disabled], html input[disabled] {
  cursor: default
}

button::-moz-focus-inner, input::-moz-focus-inner {
  border: 0;
  padding: 0
}

input {
  line-height: normal
}

input[type="checkbox"], input[type="radio"] {
  box-sizing: border-box;
  padding: 0
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  height: auto
}

input[type="search"] {
  -webkit-appearance: textfield;
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  box-sizing: content-box
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none
}

fieldset {
  border: 1px solid silver;
  margin: 0 2px;
  padding: 1.493vw 2.667vw 3.2vw
}

legend {
  border: 0;
  padding: 0
}

textarea {
  overflow: auto
}

optgroup {
  font-weight: bold
}

table {
  border-collapse: collapse;
  border-spacing: 0
}

td, th {
  padding: 0
}

 

转载于:https://www.cnblogs.com/ginkgo-leaves/p/10711697.html

您是否还为花几个小时,甚至几天对网页效果图进行切片、制作DIVCSS而烦恼? 您是否还为完成紧急任务,而人手不足而苦恼? 您是否还为快速展示、快速开发、快速成交而苦恼? 您是否还为制作标准的div+css,反反复复的调试而苦恼? ........ 用本软件吧,只需要导入效果图,拉框线就可以生成标准的兼容性的DIV+CSS,是公众号开发、手机网页开发、平板网页开发、网页制作,网页切片、企业网站、门户网站网页布局开发、批量做模板的最佳工具。 好的工具可以让您事半功倍,还等什么呢,赶快行动吧! 您是否还为花几个小时,甚至几天对网页效果图进行切片、制作DIVCSS而烦恼? 您是否还为完成紧急任务,而人手不足而苦恼? 您是否还为快速展示、快速开发、快速成交而苦恼? 您是否还为制作标准的div+css,反反复复的调试而苦恼? ........ 用本软件吧,只需要导入效果图,拉框线就可以生成标准的兼容性的DIV+CSS,是公众号开发、手机网页开发、平板网页开发、网页制作,网页切片、企业网站、门户网站网页布局开发、批量做模板的最佳工具。 好的工具可以让您事半功倍,还等什么呢,赶快行动吧! 软件具有以下特点: 软件自动对齐切片,保证切片准确无误 可手工进行细调,灵活多变 可保存设计文档,以便下次使用 多个批量操作菜单,快速方便 自动升级,功能自动增强 一次注册,终身服务 支持IE6、IE7、IE8、IE9、火狐、谷歌浏览器、360浏览器、搜狗高速浏览器、傲游浏览器、腾讯TT浏览器、苹果浏览器、世界之窗浏览器等等现在常用的浏览器 一个好的软件,几分钟就可以搞定几个小时、甚至几天的工作,高效快捷,您还等什么呢,赶快下载试用吧! 软件具有以下特点: 软件自动对齐切片,保证切片准确无误 可手工进行细调,灵活多变 可保存设计文档,以便下次使用 多个批量操作菜单,快速方便 自动升级,功能自动增强 一次注册,终身服务 支持IE6、IE7、IE8、IE9、火狐、谷歌浏览器、360浏览器、搜狗高速浏览器、傲游浏览器、腾讯TT浏览器、苹果浏览器、世界之窗浏览器等等现在常用的浏览器 一个好的软件,几分钟就可以搞定几个小时、甚至几天的工作,高效快捷,您还等什么呢,赶快下载试用吧!
### Pad按钮点击变色并自动还原的方法 为了实现在Pad当用户点击按钮时改变颜色并在一段时间后恢复原始状态的效果,可以采用CSSJavaScript相结合的方式。下面是一个简单的例子来展示如何实现这一功能。 #### 使用HTML定义按钮结构 ```html <button id="myButton">Click Me!</button> ``` #### 利用CSS设置初始样式以及激活后的样式 通过`:active`伪类可以在按下按钮期间应用不同的样式;然而对于更复杂的交互效果(比如保持高亮几秒钟),则需要借助于额外的状态管理[^1]。 ```css /* 设置默认外观 */ #myButton { padding: 10px 20px; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease-in-out; /* 平滑过渡 */ } /* 当被按下的时候立即生效的颜色变化 */ #myButton.active { background-color: red !important; /* 变更为红色或其他指定颜色 */ } ``` #### JavaScript用于处理事件监听及定时器逻辑 这里编写一段脚本来控制按钮的行为,在检测到点击之后添加`.active`类名使它变为新的颜色,并利用setTimeout函数设定延迟时间以便稍后再移除该类从而恢复正常显示。 ```javascript document.getElementById('myButton').addEventListener('click', function() { var button = this; // 添加 'active' 类以更改背景色 button.classList.add('active'); // 延迟500毫秒(半秒)后移除 'active' setTimeout(function(){ button.classList.remove('active'); }, 500); }); ``` 这种方法不仅适用于PC浏览器环境中的开发工作,同样也适合移动设备平板电脑上的网页应用程序设计。如果是在原生移动APP内,则可能涉及到不同框架的具体API调用方式,但核心思路是一致的——即先修改界面元素属性,再经过一定间隔重置这些属性回到原来的样子。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值