【发布时间】:2020-06-18 10:51:04
【问题描述】:
很难弄清楚为什么这两个 html 元素会重叠。下面是各个元素的 HTML 和 CSS 文件。我在这里搜索了很多线程,但没有一个解决方案有效。谢谢!
main.css:
#titlesection {
height: auto;
width: 100%;
margin: auto;
padding: 0px;
margin-top: 25px;
margin-bottom: 25px;
position: absolute;
display: block;
}
#contentdiv {
top: 30%;
left: 2%;
width: 97%;
margin: auto;
height: 100%;
position: absolute;
display: block;
}
#title {
padding-top: 50px;
text-align: center;
font-size: 60px;
letter-spacing: 6px;
display: block;
margin-bottom: 1%;
height: auto;
}
#titlesubheading {
margin-top: 10px;
margin-bottom: 10px;
font-size: 30px;
text-align: center;
letter-spacing: 7px;
display: block;
height: auto;
}
#socialmedia {
width: 97%;
display: block;
}
#smtable {
width: 10%;
float: right;
}
#aboutheader {
width: 95%;
margin: auto;
margin-top: 5%;
padding: 10px;
font-size: 30px;
display: block;
position: static;
}
#about {
width: 95%;
margin: auto;
margin-top: 1%;
padding: 0px;
height: auto;
font-size: 20px;
display: block;
}
#abouttext {
width: 60%;
height: auto;
display: block;
margin-left: 10px;
min-height: 140px;
}
index.html:
<body>
<section id="titlesection">
<div id="title">
Abdullah Rehmat
</div>
<div id="titlesubheading">
Freelance Developer
</div>
<div id="socialmedia">
<table id="smtable">
<tbody>
<tr>
<td class="a">
<a href="mailto: rehmat.dev@gmail.com">
<img
src="{{url_for('static', filename='images/email.png')}}"
width="33"
height="33"
/>
</a>
</td>
<td class="a">
<a href="https://twitter.com/ARehmat20" target="_blank">
<img
src="{{url_for('static', filename='images/twitter0.svg')}}"
width="50"
height="50"
/>
</a>
</td>
<td class="a">
<a href="https://github.com/10CodeDev" target="_blank">
<img
src="{{url_for('static', filename='images/github.png')}}"
width="30"
height="30"
/>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<div id="contentdiv">
<div id="aboutheader">
About:
</div>
【问题讨论】:
-
嗨,阿卜杜拉。看看你的 HTML-Sample,它在最后被切断了。有了完整的示例,SO 上的人可以更好地帮助您。
-
现在编辑