CSS3制作苹果风格键盘特效
网站建设 2023-01-28 21:38www.1681989.com免费网站
效果预览
html标签
复制代码
代码如下:<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>CSS3 KeyBoard</title>
<lk rel="stylesheet" href="font.css" type="text/css" >
<lk rel="stylesheet" href="style.css" type="text/css" >
</head>
<body>
<ul>
<li>Q</li>
<li>W</li>
<li>E</li>
<li>R</li>
<li>T</li>
<li>Y</li>
<li>U</li>
<li>I</li>
<li>O</li>
<li>P</li>
<li class="icon"></li>
<li>A</li>
<li>S</li>
<li>D</li>
<li>F</li>
<li>G</li>
<li>H</li>
<li>J</li>
<li>K</li>
<li>L</li>
<li>return</li>
<li class="icon"></li>
<li>Z</li>
<li>X</li>
<li>C</li>
<li>V</li>
<li>B</li>
<li>N</li>
<li>M</li>
<li><span>!</span><span>,</span></li>
<li><span>?</span><span>.</span></li>
<li class="icon"></li>
<li>.?123</li>
<li></li>
<li>.?123</li>
<li class="icon"></li>
</ul>
</body>
</html>
CSS代码
复制代码
代码如下:@font-face {
font-family: 'ioon';
src:url('http://upimage-img.stor.saapp./ioon.eot');
src:url('http://upimage-img.stor.saapp./ioon.eot?#iefix') format('embedded-opentype'),
url('http://upimage-img.stor.saapp./ioon.woff') format('woff'),
url('http://upimage-img.stor.saapp./ioon.ttf') format('truetype'),
url('http://upimage-img.stor.saapp./ioon.svg#ioon') format('svg');
font-weight: normal;
font-style: normal;
}
body {
background-color: #000;
}
ul, li {
list-style: none;
marg: 0;
paddg: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
ul {
width: 704px;
background: lear-gradient(60deg, rgba(158,180,185,1), rgba(222,157,193,1) 50%, rgba(169,156,173,1) 100%);
paddg-left: 8px;
border-radius: 5px;
paddg-: 10px;
}
ul::after {
content: "";
display: table;
clear: both;
}
li {
font-family: "Vrda";
width: 54px;
height: 50px;
le-height: 50px;
background-color: rgba(255,255,255,.9);
border-radius: 5px;
float: left;
text-align: center;
font-size: 24px;
vertical-align: text-;
marg-right: 10px;
marg-bottom: 10px;
box-shadow: 0 1px 0 rgba(0,0,0,.5);
cursor: poter;
position: relative;
}
li:active {
box-shadow: set 0 1px 0 rgba(0,0,0,.5);
:1px;
}
.icon {
font-family: "ioon";
}
li:nth-child(11), li:nth-child(21), li:nth-child(22),
li:nth-child(32), li:nth-child(33), li:nth-child(35), li:nth-child(36) {
background: rgba(188,188,188,.5);
font-size: 20px;
}
li:nth-child(12) {
marg-left: 20px;
}
li:nth-child(21) {
width: 98px;
}
li:nth-child(n+22) {
width: 52px;
}
li:nth-child(32) {
width: 74px;
}
li:nth-child(33) {
width: 176px;
}
li:nth-child(34) {
width: 362px;
}
li:nth-child(35) {
width: 74px;
}
li:nth-child(31), li:nth-child(30) {
box-sizg: border-box;
paddg-: 14px;
}
li:nth-child(31) span, li:nth-child(30) span {
display: block;
le-height: 0.5;
}