Looking for help with switching content using pure CSS
. I'm not very skilled with CSS
and would prefer to avoid using JavaScript
if possible. Any assistance would be greatly appreciated.
Below is a snippet of the code:
- If A is clicked,
toggle-on-content
will display andtoggle-off-content
will hide - If B is clicked,
toggle-off-content
will display andtoggle-on-content
will hide toggle-on-content
will display andtoggle-off-content
will hide by default
.toggle-on-content{
color: #dd7e6b
}
.toggle-off-content{
color: #6bbedd
}
.btn {
border: 3px solid #16982b;
display: inline-block;
padding: 3px;
position: relative;
text-align: center;
transition: background 600ms ease, color 600ms ease;
}
... (CSS code continues)
<input id="toggle-on" class="toggle toggle-left" name="toggle" value="false" type="radio" checked>
<label for="toggle-on" class="btn">A</label>
<input id="toggle-off" class="toggle toggle-right" name="toggle" value="true" type="radio">
<label for="toggle-off" class="btn">B</label>
<p class="toggle-on-content">
A lifecycle method is any method that is annotated with @BeforeAll, @AfterAll, @BeforeEach or @AfterEach annotation. The lifecycle methods execute before or after executing the actual test methods.
</p>
<p class="toggle-off-content">
To see how this works, let’s take a look at the following example:
</p>
https://i.stack.imgur.com/aEwzw.png