我有我的功能部分内的一堆元素 - 我希望这个部分变成白色,并提出一个按钮,说“下一个问题”,当计时器达到零。我已经得到了完整的JavaScript(所以当计时器达到零时,将调用一些函数来改变CSS样式),它工作正常。发现它很难白出一个部分,并提出一个按钮
问题是,我不知道要修改什么或做的CSS方面来实际达到我想要的效果。我遇到的麻烦是除了“下一个问题”按钮之外的部分。这就是它现在的样子:
我想在整个文本,定时器以及开始和跳过按钮上打开整个部分。
HTML:
<section class="features">
<p class = 'new-question'> The text displaying MMI questions will go here. </p>
<div class = 'middle-center'>
<h2>Completed</h2>
<button type='button' class='nbtn nbtn-1 nbtn-1a btn-next-question'>Next Question</button>
</div>
<div class = 'bottom-right'>
<button type='button' class='nbtn nbtn-1 nbtn-1a btn-start'>Start</button>
<button type='button' class='nbtn nbtn-1 nbtn-1a btn-skip'>Skip</button>
</div>
<div class = 'bottom-left timer-style'>
<span id ='countdown-2-minutes'>2:00</span>
<span id ='countdown-8-minutes'>8:00</span>
</div>
</section>
CSS:
.features {
position: relative;
margin-top: 10px;
min-height: 400px;
border: 1px solid #C4C4C4;
border-radius: 2px;
color: #BA8960;
overflow: hidden;
background-color: #F5F5F5;
}
.new-question {
font-family:Roboto;
font-size: 23px;
margin: 20px 20px;
}
/* buttons */
.timer-style{
text-transform: uppercase;
letter-spacing: 1px;
font-size: 20px;
margin: 15px 10px;
span{
margin: 0px 20px;
}
.bottom-right{
position: absolute;
bottom: 0;
right: 0;
}
.bottom-left{
position: absolute;
bottom: 0;
left: 0;
}
.middle-center{
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
谢谢 - 这工作很好(加上我学到了一些新的CSS!) –