共 19 篇文章 |
|
鼠标滑过 animation动画暂停animation-play-state: paused;.play-state {width: 100px;height: 100px;margin: 40px;text-align: center;line-height: 94px;border: 3px solid #e1efde;border-radius: 50%;animation: play-state 3s linear infinite;.play-state:hover {@keyframes play-state {margin-left: 0;margin-left: 200px; 阅882 转0 评0 公众公开 19-11-08 14:11 |
缩放属性 resize:both;<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> textarea{ resize:both;} div{ width: 100px;height: 100px;background-color: #ccc;resize: both;overflow: auto;} </sty... 阅1113 转0 评0 公众公开 18-12-21 14:55 |
不定高度 文字垂直居中 css.father{ width: 293px;height: 195px; background: rgba(16,16,16,.4); text-align: center; padding: 72px 5px; font-size: 18px; color: #fff; font-weight: 300; transition: bottom .4s; box-sizing: border-box; display: table; }.father span{ vertical-align: middle; display: tab... 阅425 转0 评0 公众公开 18-11-29 11:23 |
禁止各浏览器标签的选中功能.box{ /* 禁止各浏览器标签的选中功能 */ moz-user-select: -moz-none; -moz-user-select: none; -o-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -ms-user-select:none; user-select:none;} 阅40 转0 评0 公众公开 18-11-21 09:33 |
将图片作为div的before<i>666</i>.ms_con_con .ms_price i{position: relative;padding-left: 22px;font-weight: 400;font-size: 50px;}.ms_con_con .ms_price i:before{position: absolute;left: 0;top: 20px;content: "";display: block;width: 20px;height: 30px;background: url(../images/6-1.png) no-repeat cente... 阅74 转0 评0 公众公开 18-11-15 13:59 |
阅171 转1 评0 公众公开 18-09-13 13:56 |
移动端给body添加背景色 铺满屏幕<meta name="viewport" content="user-scalable=no, width=750">给body添加background时会发生整个屏幕都变色添加一个div代替bodydiv.all{width:100%;height:auto;overflow:hidden;background:#ff4000;} 阅1441 转1 评0 公众公开 18-09-13 12:00 |
click/hover 设置边框时,该元素内的内容发生下移给元素本身添加该属性(border),当hover/click时只是改变了该属性的值(颜色)而不是添加该属性,这样可以保证位置不变div { border: 1px solid #fff; }div:hover {border: 1px solid #ff5000;}div.current {border: 1px solid #ff5000;}$("div").click(function(){if($(this).hasC... 阅179 转0 评0 公众公开 18-09-13 11:56 |
阅2470 转18 评0 公众公开 18-09-13 11:38 |