2016-04-28 28 views
0

好的,我创建了一个网站,并在我的一个页面上有几个图像,您可以从下面的代码中看到它们都具有img标签。我知道你需要让不同的图像独一无二,以便它们不会全部遵循相同的css标签,但我努力使我的工作,因为他们都遵循“img”css标签,我无法解决问题。也出于某种原因,图像已经在页脚结束了,即使没有任何CSS它仍然停留在那里。如何在html文档中存在多个图像时定位图像

HTML代码

<h4>Download CV</h4> 
     ˚<p> If you want to see my full resume please click the link below and enjoy!</p> 
     <a download="Curriculum Vitae RWP.docx" href="../Curriculum Vitae RWP.docx" title="R**** A*** CV"> 
     <div class ="imagelist" id = "imagelist" > 
     <img class="imagelist" alt="CV" src="../Images/cv.png" width ="150" height="150" /> 
     </a> 

CSS代码

imagelist{ 
margin-left:500px; 
} 

img{ 
float:none; 
margin-top: 50px; 
margin-left: 20px; 
} 
+0

'margin-left:500px'是一个很大的红旗,你可能做错了什么。 –

+0

退房[** LearnLayout.com **](http://learnlayout.com/) –

+0

没有,这只是一个测试,看看是否有任何改变,这在我的情况并没有 – stevenperry94

回答

0

你可能要关闭您的div.imagelist

<h4>Download CV</h4> 
<p> If you want to see my full resume please click the link below and enjoy!</p> 
<a download="Curriculum Vitae RWP.docx" href="../Curriculum Vitae RWP.docx" title="R**** A*** CV"> 
    <div class ="imagelist" id = "imagelist" > 
    <img class="imagelist" alt="CV" src="../Images/cv.png" width ="150" height="150" /> 
    </div> 
</a> 

此外,使用同一类上的IMG作为它的家长不会以你的造型结束。我建议从IMG标签卸下类和目标与下面的CSS您的图像列表内的图像:

.imagelist img {} 

对于当前的CSS,你忘了把一个点在前面图像列表的

希望这可以帮助你保持持续不断。