Javascript 为什么我的css图像不能保持静止?
嘿,伙计们,我一直在努力保持我的css图片和链接不动。我的位置是相对的,但仍在移动。这是为什么 我也试着绝对地做,但当我尝试增加宽度和高度时,它不会移动 当我将鼠标悬停在图片和链接上时,我会尽量保持图片和链接的静止。当我使用相对位置时,我认为一切都是正确的 这是我的密码笔 还有我的密码Javascript 为什么我的css图像不能保持静止?,javascript,html,css,Javascript,Html,Css,嘿,伙计们,我一直在努力保持我的css图片和链接不动。我的位置是相对的,但仍在移动。这是为什么 我也试着绝对地做,但当我尝试增加宽度和高度时,它不会移动 当我将鼠标悬停在图片和链接上时,我会尽量保持图片和链接的静止。当我使用相对位置时,我认为一切都是正确的 这是我的密码笔 还有我的密码 *{ margin: 0px; padding 0px; } body{ background-image: url('http://pxwallpaper.com/wp-content/upload
*{
margin: 0px;
padding 0px;
}
body{
background-image: url('http://pxwallpaper.com/wp-content/uploads/2013/08/barcelona-black-new-wallpaper-94.jpg');
background-size:cover;
}
#container{
width: 900px;
height: 900px;
background-color: white;
margin: 60px auto;
overflow:auto;
}
img.size{
width:100px;
height:100px;
-webkit-filter:grayscale(90%);
opacity:0.4;
transition:all 0.5s;
}
#container ul{
margin:70px 30px 6px 10px;
}
#container li{
float:left;
margin: 30px;
list-style-type:none;
cursor:pointer;
position: relative;
width:100px;
height:100px;
}
#container img:hover{
filter:grayscale(0%);
-webkit-filter: grayscale(0%);
opacity: 2;
width:160px;
height:160px;
}
<html>
<head>
</head>
<title>
</title>
<body>
<div id="container">
<ul>
<li><img class="size" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRnNn3yg1C8fjtxGOHRLfYWRGnd-jsxPc8eZrd
rVfYtm4P73YEm9w"></li>
<li><img class="size" src="http://kodiakherbal.com/wp-content/uploads/2013/03/canmore_rocky_mountains-hd-wallpaper.jpg"></li>
<li><img class="size" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRnNn3yg1C8fjtxGOHRLfYWRGnd-jsxPc8eZrdrVfYtm4P73YEm9w"></li>
<li><img class="size" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRnNn3yg1C8fjtxGOHRLfYWRGnd-jsxPc8eZrdrVfYtm4P73YEm9w"></li>
<li><img class="size" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRnNn3yg1C8fjtxGOHRLfYWRGnd-jsxPc8eZrdrVfYtm4P73YEm9w"></li>
<li><img class="size" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRnNn3yg1C8fjtxGOHRLfYWRGnd-jsxPc8eZrdrVfYtm4P73YEm9w"></li>
</ul>
</div>
</body>
</html>
*{
边际:0px;
填充0px;
}
身体{
背景图像:url('http://pxwallpaper.com/wp-content/uploads/2013/08/barcelona-black-new-wallpaper-94.jpg');
背景尺寸:封面;
}
#容器{
宽度:900px;
高度:900px;
背景色:白色;
保证金:60像素自动;
溢出:自动;
}
img.size{
宽度:100px;
高度:100px;
-webkit过滤器:灰度(90%);
不透明度:0.4;
过渡:均为0.5s;
}
#集装箱保险{
利润率:70px 30px 6px 10px;
}
#集装箱李{
浮动:左;
利润率:30像素;
列表样式类型:无;
光标:指针;
位置:相对位置;
宽度:100px;
高度:100px;
}
#容器img:悬停{
滤镜:灰度(0%);
-webkit过滤器:灰度(0%);
不透明度:2;
宽度:160px;
高度:160px;
}
尝试将宽度:220px更改为200px
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
width: 200px;
}
尝试更改宽度:220px到200px
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
width: 200px;
}
尝试更改宽度:220px到200px
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
width: 200px;
}
尝试更改宽度:220px到200px
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
width: 200px;
}
不要在悬停样式上设置宽度
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
}
不要在悬停样式上设置宽度
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
}
不要在悬停样式上设置宽度
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
}
不要在悬停样式上设置宽度
#box li:hover{
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
opacity:1;
}