I am trying to implement collapsible buttons on my web-app (built through GAS). I am new to building pages in html so i am a bit stuck with a problem and didn't really find any answers on other topics.
The buttons work properly and hide/show the content i want through jquery, i pasted the snippets needed in head and body. My problem is that the bootstrap buttons are styled a certain way and it doesn't fit my web-app global aspect, so i would like to be able to customize it at will.
But to do so, I need to find and read the specifics of each bootstrap classes in order to override it correctly.
I thought it would be better not to post my whole code because it's a theorical question.
So I have my button:
<button type="button" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Button with data-target
</button>
Which targets the pannel:
<div class="collapse" id="collapseExample">
<div class="card card-body">
<table>
<tr>
<td colspan="3">OK</td>
<td>OK</td>
<td colspan="3">OK</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
</table>
</div>
</div>
Specifically i would like to be able to change the background when the button is active/clicked.
I tried inspecting the page but declaring the class
.collapse show{
background-color: red;
}
didn't change a thing, and anyways, i am not even sure that is the correct way to do it.
For info, these are the links pasted:
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
and in the body:
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js" integrity="sha384-eMNCOe7tC1doHpGoWe/6oMVemdAVTMs2xqW4mwXrXsW0L84Iytr2wi5v2QjrP/xp" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.min.js" integrity="sha384-cn7l7gDp0eyniUwwAZgrzD06kc/tftFf19TOAs2zVinnD/C7E91j9yyk5//jjpt/" crossorigin="anonymous"></script>
Any help is welcome! Thanks