我在设置引用样式时遇到了问题。我想要把引号往下移一点,以便与文本对齐。我尝试使用相对和绝对定位进行调整,但是无法解决问题。这个程序将成为一个随机引语生成器,因此结束引语的位置必须相对于文本对齐,即使有一段引语占据了多行。
body {
background-color: rgb(44, 62, 80);
}
.quoteMachine {
margin: 100px auto 0 auto;
padding: 40px 60px;
max-width: 600px;
min-height: 225px;
border-radius: 5px;
background-color: white;
}
.theQuote {
text-align: center;
font-size: 30px;
color: rgb(44, 62, 80);
}
.quotetationMarks {
font-size: 60px;
font-weight: 600;
}
.quoteAuthor {
text-align: right;
font-size: 20px;
color: rgb(44, 62, 80);
}
.twitterButton {}
<div class="quoteMachine">
<div class="theQuote">
<blockquote><span class="quotetationMarks">“</span > They call me Mister Tiibs <span class="quotetationMarks">”<span></blockquote>
</div>
<div class="quoteAuthor">
- hello
</div>
<button class="twitterButton"></button>
<button class="newQuoteButton"></button>
</div>
.quotetationMarks
(你示例中的引号)编写一个 CSS 选择器 - 然后你可以设置它的position: relative
并使用top
或bottom
位置值将其上下移动。另外,请参考 @Utkanos 的关于拼写的建议。 - Geoff James