Html 如何从左下角对焦图像?

Html 如何从左下角对焦图像?,html,css,image,focus,Html,Css,Image,Focus,我把一切都弄清楚了,但我似乎无法超越边际上限。我需要第四个孩子从底部集中注意力,而不是从中间集中注意力 .gallerya a:focus img{ width: 350%; height: 350%; margin-left:-120%; margin-top:-50%; position: absolute; opacity: 1; z-index: 1; -moz-box-shadow: 0 0 5px 1px #4D4D4D; -webkit-box-shadow: 0 0 5px

我把一切都弄清楚了,但我似乎无法超越边际上限。我需要第四个孩子从底部集中注意力,而不是从中间集中注意力

.gallerya a:focus img{
width: 350%; 
height: 350%;
margin-left:-120%;
margin-top:-50%;
position: absolute;
opacity: 1; 
z-index: 1; 
-moz-box-shadow: 0 0 5px 1px #4D4D4D;
-webkit-box-shadow: 0 0 5px 1px #4D4D4D;
box-shadow: 0 0 5px 1px #4D4D4D; 
-webkit-transition-duration: 1s; 
-webkit-transition-delay: 0.1s; 
-moz-transition-property: width, height;
-moz-transition-duration: 1s;
-moz-transition-delay: 0.1s;
-o-transition-property:width, height;
-o-transition-duration: 1s;
-o-transition-delay: 0.1s;
cursor: default;
}

.gallerya a:first-child img{
margin-left: 0;
margin-top: 0;
}

.gallerya a:nth-child(3) img{
right:0;
margin-top: 0;
}

.gallerya a:nth-child(4) img{
margin-left:0;
}

老实说,你想要达到什么目标还不是很清楚。如果您的意思是要重置页边距顶部:-50%,并使用此图像的底部/左侧位置,您可以简单地尝试

margin-top:auto; // reset
margin-left:0px!important;
margin-bottom:0px!important;

你是说底部是这样固定的吗

margin-top:auto; // reset
margin-left:0px!important;
bottom:0px!important;

你的意思是去除第四个元素和页面顶部之间的间隙?不,默认情况下,img从左上角聚焦,左边距:-120%;利润率最高:-50%;在a中:聚焦img从中心聚焦img(我需要这个用于中心img);右:0;边际上限:0;覆盖页边距左侧和页边距顶部;但是我不知道如何使第四幅图像从左下角对焦(我把左下角的部分取下来,但不是底部),我只想让第四幅图像从左下角对焦,而不是左上角对焦,添加页边距top:auto;左边距:0px!重要的;保证金底部:0px!重要的;致gallerya:第四个孩子(4)img没有锻炼!打字错误:(是的,很好,谢谢!我试了底部:0;和底部:0%;但不是底部:0px;。学习CSS还有很多路要走