我有兩個單獨的<span>
元素,目前出現在彼此的上方/下方。我想讓它們並排出現。我讀過一堆這樣的答案,解決方案是使用float
,但它只是不適合我(也許我的HTML/CSS關閉?)我希望能夠顯示/幻燈片附加文本用戶懸停在該特定按鈕上。位置二<span>彼此相鄰的元素
HTML:
<div class="skills">
<div class="container">
<div class="row">
<div class="col-md-4">
<h1>Tutoring</h1>
<p>Weekly one on one tutor, teaching concepts of object oriented programming and introduction to game design with Java and the Dr. Java IDE</p>
<button type="button" class="round-button" onclick="clickTutoring()">
<span>></span>
<span class="button-hover">Click here to learn more</span>
</button>
<!-- ...other things here... -->
</div>
</div>
</div>
</div>
CSS:
.round-button {
display: block;
width: 40px;
height: 40px;
line-height: 30px;
border: 2px solid #f5f5f5;
border-radius: 50%;
color: #f5f5f5;
text-align: center;
background: #464646;
outline: none;
}
.button-hover {
display: inline;
white-space: nowrap;
background-color: #464646;
}
JS:
$(document).ready(function() {
//Hide the Click Here text upon loading the webpage
$('.button-hover').hide();
//Upon hovering, text will show across the across
var buttonHover = $(function() {
$('.round-button').hover(function() {
$('.button-hover').toggle('slide');
});
});
});