我有4 a
-tags。每個CSS作品中的所有內容。它在我的手機上完美調整了按鈕的大小。我唯一的問題是在我的手機上,登錄/註冊按鈕,按鈕內的文字切割以及它顯示的全部內容是登錄/註冊。文字環繞按鈕
從我記得white-space: normal
是這樣做的方式,但也許我錯了。
@media only screen and (max-device-width: 480px) {
.newsButton {
width: 49%;
height: 140px;
white-space: normal;
float: left;
}
.venueButton {
width: 49%;
height: 140px;
white-space: normal;
float: right;
}
.learnButton {
width: 49%;
height: 140px;
white-space: normal;
float: left;
}
.loginButton {
width: 49%;
height: 140px;
white-space: normal;
float: right;
}
}
<a href="menu.php" class="newsButton" data-role="button" data-theme="e">News</a>
<a href="venue.php" class="venueButton" data-role="button" data-theme="e">Venue Hire</a>
<a href="learn.php" class="learnButton" data-role="button" data-theme="e">Learn</a>
<a href="login.php" class="loginButton" data-role="button" data-theme="e">Login/Register</a>
不reproduceable。問題文本中描述的行爲取決於代碼中未包含的設置,可能是非常大的字體大小,也可能是「溢出」設置。問題的標題是「按鈕內的文字換行」,但文字換行在問題中根本沒有提及。你真的*想要*文本包裝,例如如果需要,在「登錄/」下方出現「註冊」? –