[英]I can't figure out what is wrong with this code
This code gives me: image of broken layout I just want the p
tag class .mailtext
to be inside the footer and not outside as it does.这段代码给了我:损坏布局的图像我只希望
p
标记类.mailtext
位于页脚内部,而不是像它那样位于外部。
I don't know if this counts as you doing my homework but this is driving me crazy the last two days.我不知道这是否算作你在做我的作业,但这在过去两天让我发疯。 The first
p
tag (the copyright text) works perfectly, but the second one is not.第一个
p
标签(版权文本)工作正常,但第二个不是。 I have tried a lot of different solutions.我尝试了很多不同的解决方案。 I have come up with solutions such as changing the
overflow
, z-index
, making div
container bigger, but nothing worked.我想出了解决方案,例如更改
overflow
, z-index
,使div
容器更大,但没有任何效果。 I am a student and not experienced.我是学生,没有经验。 Any ideas?
有任何想法吗?
.footer { /* more info footer */ height: 200px; background-color: black; margin-top: 80px; position: absolute; right: 0; left: 0; overflow: hidden; } .rights { /* copyright paragraph */ text-align: center; color: white; margin-top: 170px; } .mail { /* mail icon properties */ position: relative; bottom: 140px; left: 377px; } .mailtext { /* my email text properties */ position: relative; color: red; } .feedback { /* feedback icon properties */ position: relative; bottom: 190px; left: 430px; }
<footer class="footer"> <div class="moreinfo"> <!-- more info footer --> <p class="rights">©2017 annu.com. All rights reserved.</p> <!-- copyright symbol --> <a target="_blank" href=""> <img class="feedback" src=""> </a> <!-- feedback logo --> <img class="mail" src=""> <!-- mail logo --> <p class="mailtext">aaaaaa@gmail.com</p> </div> </footer> <!-- /Footer -->
.rights
has a large margin-top
on it. .rights
有一个很大的margin-top
。 This makes it start near the bottom of the footer.这使它从页脚底部附近开始。
The paragraph after it, appears after it, below the footer (and off the screen).它之后的段落出现在它之后,在页脚下方(并在屏幕外)。
You need to leave enough space (whether by increasing the height of the footer, using a minimum instead of fixed height, using a smaller margin on the paragraph, or some other means) for your content to appear in.您需要留出足够的空间(无论是通过增加页脚的高度,使用最小高度而不是固定高度,在段落上使用较小的边距,还是其他方式)让您的内容出现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.