我正在制作一个单页网站。对于“较低”页面,我将图像作为标题。我可以使用使图像居中
img
{
display:block
margin-left:auto
margin-right:auto
width:400px
}
但是,我要求它低一点。我尝试添加页边距顶部,但似乎为整个页面添加了页边距(页面变长了?)。但是,图像在我的页面上的位置并没有改变。知道有什么问题吗?
这是一些 HTML:
<body>
<div id="nav">
<ul>
<li><a class="scroll" href="#about">ABOUT</a></li>
<li><a class="scroll" href="#portfolio">WORK</a></li>
<li><a class="scroll" href="#contact">CONTACT</a></li>
</ul>
</div>
<!-- Landing Page-->
<div id="landing">
<img src="front.png" alt="Cover Page">
</div>
<!-- About -->
<div id="page1">
<a id="about"></a>
<img src="Who.png" alt="About Me">
<p>
That sweet tailpipe of yours did have me charmed. It put a spell on me, but all the ass magic in Mexico can’t change Kenny Powers from his core beliefs. I’m not an ass man... I’m a tit man. I like big ass boobs — now, and forever... I’m not like a black guy, Vida...
</p>
</div>
<!-- Work -->
<div id="page2">
<a id="portfolio"></a>
<div id="container">
<a class="fancybox" href="portfolio1.jpg" title="'Consumed' </br>Digital/Print Work"><img src="portfolio1s.png"/></a>
</div>
</div>
<!-- Contact -->
<div id="page3">
<a id="contact"></a>
<img src="Contact.png" alt="Contact Information">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
</body>
我正在谈论的标题是较低页面的标题,而不是第一个元素。所以我不确定为什么整个页面都向下移动。