我有两个单独的<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');
});
});
});