Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在CSS中向上移动图像_Html_Css_Laravel_Laravel 5_Blade - Fatal编程技术网

Html 在CSS中向上移动图像

Html 在CSS中向上移动图像,html,css,laravel,laravel-5,blade,Html,Css,Laravel,Laravel 5,Blade,所以,在过去的一个小时里,我一直在尝试使用css属性position移动这个图像。我的问题是每次使用top或bottom移动它时,它都无法正常工作。这里是一个使用上述属性和属性的屏幕截图。下面你可以找到我的html和css。最后,此位置必须为绝对位置,否则图像将完全消失 HTML 添加以下内容如何: .interaction { position: relative; } 我想你应该把no repeat和background放在同一行 这对我来说很有用,我不知道为什么 .heart{

所以,在过去的一个小时里,我一直在尝试使用css属性
position
移动这个图像。我的问题是每次使用
top
bottom
移动它时,它都无法正常工作。这里是一个使用上述属性和属性的屏幕截图。下面你可以找到我的html和css。最后,此
位置
必须为
绝对位置
,否则图像将完全消失

HTML


添加以下内容如何:

.interaction {
    position: relative;
}

我想你应该把
no repeat
background
放在同一行

这对我来说很有用,我不知道为什么

.heart{
    background: url('http://localhost:8079/uncaughterror/public/src/img/web_heart_animation.png');
    background-position: left;
    background-repeat: no-repeat;
    height: 50px; width: 50px;
    cursor: pointer;
    position: absolute;
    left: 12px;
    bottom: 5px; //This or 'top' is what causes my entire problem
    background-size:1450px;
}

.heart:hover {
    background-position: right;
}
.interaction {
    position: relative;
}