作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
所以我正在为一个类(class)元素做这个网站,出于某种原因,如果我在屏幕上使浏览器窗口尽可能小,我页面的“关于”部分中的第二个按钮会被切成两半,无论是否设置了溢出。
我附上了按钮的图像和我的 css 和 html 的片段,看看是否有人可以弄清楚为什么这个按钮被砍掉了。 My Website (Why Should You Go Section)
.about {
position: relative;
text-align: center;
padding-bottom: 9em;
overflow: hidden;
}
.about h2 {
margin-top: 2em;
font-family: 'Didot', 'Times New Roman', serif;
font-size: 4.5em;
color: #ff5339;
/* text-align: center;*/
}
.about hr {
width: 90%;
border: 0;
height: 1px;
background: #61792f;
}
.about p {
margin-top: 2em;
margin-left: auto;
margin-right: auto;
margin-bottom: 4em;
width: 80%;
font-family: 'Open Sans', 'Arial', sans-serif;
font-size: 1.5em;
color: #61792f;
line-height: 150%;
text-align: left
}
.about a {
text-decoration: none;
font-family: 'Open Sans', 'Arial', sans-serif;
font-weight: 700;
font-size: 1.5em;
color: #ff5339;
border: 3px solid #ff5339;
padding: .3em .7em;
margin: 1em;
}
.about a:hover {
border: 3px solid #ff5339;
background-color: #ff5339;
color: #e9dec5;
}
<div class="about">
<h2>WHY SHOULD YOU GO?</h2>
<hr>
<p>Germany is a fascinating fusion of old and new. The bohemian streets of Berlin act as a fertile breeding ground for hip art, unique design and innovative ideas, while heritage-filled Munich boasts historic architecture in the form of impressive Baroque and Rococo buildings. In between, travellers will find stretches of idyllic countryside, impossibly gorgeous castles, charming university towns and boisterous Bavarian beer halls. Be introduced to the progressive cities and romantic splendour of Germany and never look back.</p>
<a href="about.html" class="learn">LEARN MORE</a>
<a href="tours.html" class="book">BOOK NOW</a>
</div>
最佳答案
这是因为空格环绕。在您的 .about a
样式中包含 white-space: nowrap;
。
关于html - 按钮切成两半,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33924053/
我有一堆大的 GeoTiff 文件(1.4GB,4 个纬度 x 8 个经度)。 我需要将每个瓷砖切成 1 度纬度 x 1 度长的瓷砖(每个瓷砖都只有一点点超龄)。 这是 GeoTiff 文件之一的 g
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 4 年前。 Improve this ques
我是一名优秀的程序员,十分优秀!