Despite having no programming experience, I am attempting to create a FAQ section for our help site using collapsible sections for the Q&A. While I've managed to achieve most of what I wanted, there is one element that stubbornly refuses to change. Despite searching for the issue in the code, I can't seem to find a solution. Any assistance would be greatly appreciated. As a complete newbie in this area, I am in need of guidance x
The HTML code I have implemented is:
<link rel="stylesheet" type="text/css" href="https://content.ilabsolutions.com/wp-content/uploads/2020/05/gradifi.css" media="screen">
<div class="wrap-collabsible">
<input id="collapsible" class="toggle" type="checkbox" value="on">
<label class="lbl-toggle" for="collapsible">Question?</label>
<div class="collapsible-content">
<div class="content-inner">
<p>Answer.</p>
</div></div></div>
</html>
input[type='checkbox'] {
display: none;
}
.wrap-collabsible {
font-style: normal;
line-height: normal;
}
.lbl-toggle {
display: block;
text-transform: none;
text-align: left;
width: 100%;
font-family: arial, sans-serif;
font-size: 1.2rem;
font-style: normal;
padding: 0.6rem;
color: #ffff;
background: linear-gradient(to right, #00A9E0, #0085D5);
cursor: pointer;
border-radius: 5px 5px 0px 0px;
transition: all 0.25s ease-out;
}
.lbl-toggle:hover {
color: #7C5A0B;
}
.lbl-toggle::before {
content: ' ';
display: inline-block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid currentColor;
vertical-align: middle;
margin-right: .7rem;
transform: translateY(-2px);
transition: transform .2s ease-out;
}
.collapsible-content .content-inner {
background: linear-gradient(to right, #f7f7f7, #f5f5f5);
border-bottom: 1px solid rgba(250, 250, 250);
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
padding: .5rem 1rem;
border-radius: 0px 0px 5px 5px;
font-family: arial, sans-serif;
}
.collapsible-content {
max-height: 0px;
overflow: hidden;
transition: max-height .25s ease-in-out;
}
.toggle:checked+.lbl-toggle+.collapsible-content {
max-height: 100%;
}
.toggle:checked+.lbl-toggle::before {
transform: rotate(90deg) translateX(-3px);
}
.toggle:checked+.lbl-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
The browsers display it like this, with the blue box text in italic font.
Update:
I'm unsure if this is the correct way to provide a solution, but I've finally managed to resolve it.
In the section .lbl-toggle {
, instead of using text-transform: none !important;
, I switched to font-style: normal!important
. This simple change worked! Thank you everyone!