html中hover和no-repeat

hover:当鼠标滑上时。

(其实就是给你鼠标要滑上的区域一个超链接,然后给它一个伪类来实现你想要实现的效果。)

(这里以我自己的项目效果为例)

no-repeat:调像素,后边紧跟的是调动的x轴y轴的值。

1.最基本的 当鼠标滑上文字文字变色。

a:hover{

color:red;

}

像这种给文字一个超链接,然后再写一个伪类实现你想要实现的效果。

1.当鼠标滑上时出现红色边框。

.body_body .body_body_img:hover{    
 
    outline: 3px solid red;
}

2.当鼠标划上出现阴影边框。

.body_body .body_body_img:hover{    
    box-shadow: #808080 5px 5px 5px 5px; /*当鼠标划上出现阴影边框*/

}

3.当鼠标划上出现红色下边框。

(1).body_body_img{
    color: gray;
    width: 240px;
    height: 340px;
    background-color: white;
    display: inline-block;
    margin-left: 10px;
    margin-top: 10px;
}
.body_body_img:hover{
    margin-bottom: -7px;
    border-bottom: 3px solid #FF2C72;
}

(2).body_body_img{
    color: gray;
    width: 240px;
    height: 340px;
    background-color: white;
    display: inline-block;
    margin-left: 10px;
    margin-top: 10px;

 border-bottom: 3px solid gainsboro;
}
.body_body_img:hover{
  
    border-bottom: 3px solid #FF2C72;
}

4.当鼠标划上空心的心出现实心的心。

原始给出的材料图是这样的:

可以用下边这段代码调出空心的心:

 width: 15px;
    height: 14px;
    background:url(../img/icon/ico.png) no-repeat 3px -70px ;

 

结合hover要实现功能代码如下:

.list_love{
    width: 15px;
    height: 14px;
    background:url(../img/icon/ico.png) no-repeat 3px -70px ;/*空心的心*/
    margin-left: 30px;
    margin-top: -35px;
}
.list_love:hover{
    background:url(../img/icon/ico.png) no-repeat -12px -70px ;/*实心的心*/
}

 

 

 

 

 

 

 

 

 

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>旋转木马版相册</title> <style> * { margin: 0; padding: 0; } body { /* 最后旋转的是section 也需要近大远小的效果 div也需要 所以透视放在body上 */ perspective: 1000px; } section { position: relative; width: 300px; height: 200px; margin: 150px auto; /* 让子元素div保持3d效果 */ transform-style: preserve-3d; animation: rotate 15s linear infinite; background: url(images/5.jpg) no-repeat; } section:hover { /* 当鼠标经过section时 动画停止 */ animation-play-state: paused; } @keyframes rotate { 0% { transform: rotateY(0) } 100% { transform: rotateY(360deg); } } section div { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; /* background: url(images/3.jpg) no-repeat; */ } section div:nth-child(1) { /* 第一张图片 */ background: url(images/1.jpg) no-repeat; transform: rotateY(0deg) translateZ(400px); } section div:nth-child(2) { background: url(images/2.jpg) no-repeat; /* 先旋转好位置 再移动 这里是移动Z轴 不是xy轴 所以不用严格要求把位移放在最前面 */ transform: rotateY(60deg) translateZ(400px); } section div:nth-child(3) { background: url(images/3.jpg) no-repeat; transform: rotateY(120deg) translateZ(400px); } section div:nth-child(4) { background: url(images/4.jpg) no-repeat; transform: rotateY(180deg) translateZ(400px); } section div:nth-child(5) { background: url(images/5.jpg) no-repeat; transform: rotateY(240deg) translateZ(400px); } section div:nth-child(6) { background: url(images/dog.jpg) no-repeat; transform: rotateY(300deg) translateZ(400px); } </style> </head> <body> <section> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </section> </body> </html>
06-05
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>旋转木马版相册</title> <style> * { margin: 0; padding: 0; } body { /* 最后旋转的是section 也需要近大远小的效果 div也需要 所以透视放在body上 */ perspective: 1000px; } section { position: relative; width: 300px; height: 200px; margin: 150px auto; /* 让子元素div保持3d效果 */ transform-style: preserve-3d; animation: rotate 15s linear infinite; background: url(images/5.jpg) no-repeat; } section:hover { /* 当鼠标经过section时 动画停止 */ animation-play-state: paused; } @keyframes rotate { 0% { transform: rotateY(0) } 100% { transform: rotateY(360deg); } } section div { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; /* background: url(images/3.jpg) no-repeat; */ } section div:nth-child(1) { /* 第一张图片 */ background: url(images/1.jpg) no-repeat; transform: rotateY(0deg) translateZ(400px); } section div:nth-child(2) { background: url(images/2.jpg) no-repeat; /* 先旋转好位置 再移动 这里是移动Z轴 不是xy轴 所以不用严格要求把位移放在最前面 */ transform: rotateY(60deg) translateZ(400px); } section div:nth-child(3) { background: url(images/3.jpg) no-repeat; transform: rotateY(120deg) translateZ(400px); } section div:nth-child(4) { background: url(images/4.jpg) no-repeat; transform: rotateY(180deg) translateZ(400px); } section div:nth-child(5) { background: url(images/5.jpg) no-repeat; transform: rotateY(240deg) translateZ(400px); } section div:nth-child(6) { background: url(images/dog.jpg) no-repeat; transform: rotateY(300deg) translateZ(400px); } </style> </head> <body> <section> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </section> </body> </html> 请您帮我修改成可以显示图片出来
06-05
body { padding: 0; margin: 0 } #unity-container { position: absolute } #unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) } #unity-container.unity-mobile { position: fixed; width: 100%; height: 100% } #unity-canvas { background: {{{ BACKGROUND_COLOR }}} } .unity-mobile #unity-canvas { width: 100%; height: 100% } #unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none } #unity-logo { width: 500px; height:600px; background: url(''logo.png'') no-repeat center } #unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center } #unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center } #unity-footer { position: relative } .unity-mobile #unity-footer { display: none } #unity-webgl-logo { float:left; width: 500px; height: 100px; background: url('logo.png') no-repeat center } #unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px } #unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center } #unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none } 做自适应全屏显示 修改进度条长度logo图片 进度条自适应 留个修改进度条图片logo图片的地方
08-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值