I hope it is okay I am asking a question about the exam on CSS. The requirement is as follows:
Complete the CSS rule for the
.button
class so that when a user hovers over the button its text color, background color, and border color only transition over a duration of 1.5 seconds.
Below is the original code I am given:
.button {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: block;
margin: auto;
border-radius: 5px;
border: thick solid #005C46;
width: 300px;
height: 100px;
background-color: #8FC9A3;
color: #005C46;
font-size: 40px;
}
.button:hover {
color: #8FC9A3;
background-color: #005C46;
border: thick solid #8FC9A3;
}
I successfully get the code to work. I simply did the following change:
.button:hover {
color: #8FC9A3;
background-color: #005C46;
border: thick solid #8FC9A3;
transition: 1.5s;
}
I also tried: transition-duration: 1.5s incase it didn’t want the equally effective short hand and wanted something more specific. Of course, both work, I hover over the button and everything transitions over a span of 1.5 seconds. Yet, I keep getting the error message asking me if I put in a transition time of 1.5 seconds.
I have even done the stupid of placing transition: 1.5s under .button, though that causes a delay in the button loading visually when I run the code and is not right as what I originally did is correct, unless I am completely blind.
Is the test question glitched, or am I missing something else entierly?