我的标题不会居中。如您所见,副标题没问题,但标题更靠左。我怎样才能解决这个问题? 网址链接:http://st358373.cmd16c.cmi.hanze.nl/portfolio.html
HTML:
<div class="titel">Portfolio</div>
<div class="subtitel">Hier is een selectie van recentelijk werk.</div>
CSS:
.titel {
font-family: Raleway;
font-size: 52px;
color: #3b3d40;
text-align: center;
font-weight: 700;
margin-top: 20px;
display: block;
}
.subtitel {
font-family: Adobe Caslon Pro;
font-size: 18px;
text-align: center;
margin-top: 40px;
margin-bottom: 50px;
}
最佳答案
您网站的问题在于您的社交图标向右浮动。因此,您需要做的就是清除标题容器。为此,您需要做的就是为您的 .titel
clear: right;
关于html - 标题不会居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41683763/