【发布时间】:2018-01-15 03:06:19
【问题描述】:
这里只是一个快速的。我正在尝试使用 float:left 将徽标放置在网页的右上角,但它似乎与其余元素一起卡在页面的中心。我试图将 text-align:center 从#showcase 中移开,但我仍然得到相同的结果。
#logo h2 {
float: left;
color: #ffffff;
text-decoration: line-through;
}
#showcase {
background-image: url("../img/sky.jpg");
height: 100vh;
background-size: cover;
background-position: center;
display: flex;
flex-direction: column;
text-align: center;
padding: 0 20px;
align-items: center;
}
.header p {
float: left;
}
#showcase h1 {
color: #ffffff;
line-height: 1.2;
word-spacing: 5;
text-transform: capitalize;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
font-size: 120px;
margin-top: 150px;
}
<body>
<header id="showcase">
<h1>404</h1>
<p>Oops! the page you're looking for cannot be found</p>
<a href="#" class="button">GO BACK</a>
<h2 id="logo">Daily UI</h2>
</header>
</body>
【问题讨论】: