【发布时间】:2018-07-23 05:35:39
【问题描述】:
我仍在学习 HTML/CSS/Js 并在 youtube 上关注本教程。
https://www.youtube.com/watch?v=7MDJtw3ZF-4&t=893s
我的问题是在 20:15 左右的时间戳,我的 eyes.png 没有出现。我觉得这很奇怪,因为我的 face.png 显示得非常好,它位于同一个文件夹中。
<p class="location"></p>
<div class="container">
<div class="face_body">
<div class="face">
<div class="eye_pan">
<div class="pan_area">
<div class="eye eye_l">
<div class="eye eye_r">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
还有我的css
html,body, .container{
height: 100%;
width: 100%;
outline: 0px;
margin: 0px;
padding: 0px;
border: 0px;
}
.location{
position: fixed;
top: 0px;
right: 0px;
margin: 0px;
background: rgba(255,255,255,0.4);
padding: 10px;
}
.container{
display: table;
background: rgb(251,220,0);
background: -webkit-linear-gradient(rgb(251,220,0), rgb(255,197,17));
background: -o-linear-gradient(rgb(251,220,0), rgb(255,197,17));
background: -moz-linear-gradient(rgb(251,220,0), rgb(255,197,17));;
background: linear-gradient(rgb(251,220,0), rgb(255,197,17));
}
.face_body{
display: table-cell;
vertical-align: middle;
text-align: center;
width: 100%;
}
.face{
height: 200px;
width: 200px;
margin: auto;
background: url(images/face1.1.png);
background-size: 173px 200px;
background-repeat: no-repeat;
}
.eye_pan{
display: table;
padding: 30px 50px;
}
.pan_area{
width: 70px;
height: 55px;
position: relative;
}
.eye{
height: 20px;
width: 20px;
border-radius: 5px;
position: absolute;
margin-left: 5px;
transition: .5s height ease-in-out;
border: 1px solid red;
background: url(images/eyes.png);
}
.eye_r{
top: 0px;
left: 20px;
}
.eye_l{
top: 50px;
left: 25px;
}
我的 eye.png 没有显示的任何原因都很好。谢谢。
【问题讨论】:
-
检查显而易见的。您的代码和文件中的拼写是否相同?眼睛png是否在预期的位置。使用浏览器开发人员工具 (F12) 及其网络选项卡查看资源是否已找到。然后使用元素检查工具检查“眼睛”元素,看看应用了哪些样式。
标签: javascript jquery html css image