我有一个缩放到屏幕尺寸的图像。我试图让左、右和关闭按钮留在图像上,但我只能让它们留在屏幕边缘。
#full_image ul{
margin:0;
padding:0;
list-style:none;
width:100%;
white-space: nowrap;
overflow:hidden;
}
#full_image li{
display:block;
margin:0;
padding:0;
}
#full_image li a {display:block}
#full_image ul li img{ margin:0 auto; max-width:100%}
#full_image .full_close{
background-color: red;
top: 10px;
cursor: pointer;
height: 29px;
opacity: 1;
position: absolute;
width: 29px;
z-index: 999;
right: 10px;
}
#full_image .next_big{
background-color: red;
top: 50%;
cursor: pointer;
height: 29px;
opacity: 1;
position: absolute;
width: 29px;
z-index: 999;
right: 0px;
}
#full_image .prev_big{
background-color: red;
top: 50%;
cursor: pointer;
height: 29px;
opacity: 1;
position: absolute;
width: 29px;
z-index: 999;
left: 0px;
color: #222;
}
<div id="full_image">
<ul><li><a href="#"> <img src="http://i.telegraph.co.uk/multimedia/archive/01636/saint-tropez-beach_1636818c.jpg" alt="" /></a></li> </ul>
<a href="#" class="full_close"></a>
<a href="#" class="button next_big"></a>
<a href="#" class="button prev_big"></a>
</div>