I’m trying to modify this code so that the actions button has a little padding that does not highlight on hover below the button.
I was trying to use my action-blank
class by sandwiching the button between 2 blank lines but the blank lines were getting highlighted.
Ideally, the ACTIONS button is present on all sections without needing to click them to appear
.vertical-menu {
width: 100%;
height: 150px;
position: relative;
}
.trend-button:hover {
background: linear-gradient(to right, transparent 2.5%, #f0f0f0 2.5%, #f0f0f0 97.5%, transparent 97.5%);
align-items: center;
}
/* Exclude blank line and blank element from hover effect */
.button-label-line>div:hover,
.actions-container>.action-blank {
background: none;
}
/* Style for the blank element */
.action-blank {
height: 0.5em;
/* Adjust height as needed */
}
.button-label-divider {
height: 5px;
}
.actions-container>.action-blank {
background: none;
}
/* Style for the blank element */
.action-blank {
height: 0.5em;
/* Adjust height as needed */
}
.vertical-menu input[type="radio"] {
position: absolute;
left: -9999px;
}
.vertical-menu label {
background-color: #eee;
color: black;
display: block;
padding: 12px;
height: 100%;
margin: 0;
text-decoration: none;
cursor: pointer;
}
.vertical-menu label:hover {
background-color: #ccc;
}
.vertical-menu input[type="radio"]:checked+label {
background-color: #04AA6D;
color: white;
}
.vertical-menu .trend-button {
display: none;
background-color: #04AA6D;
}
.vertical-menu input[type="radio"]:checked+label+.trend-button {
display: block;
text-align: center;
margin-top: -1px;
/* Adjust the margin to remove white space */
}
.vertical-menu input[type="radio"]:checked+label+.trend-button button {
width: 100%;
background-color: #04AA6D;
color: white;
border: none;
padding: 5px 10px;
cursor: pointer;
}
<div class="vertical-menu" id="menu">
<input type="radio" id="option1" name="menu-option" checked>
<label for="option1">#H1#<div class="subtitle">#S1#</div></label>
<div class="trend-button">
#ACTIONS#
</div>
<input type="radio" id="option2" name="menu-option">
<label for="option2">#H2#<div class="subtitle">#S2#</div></label>
<div class="trend-button">
#ACTIONS#
</div>
<input type="radio" id="option3" name="menu-option">
<label for="option3">#H3#<div class="subtitle">#S3#</div></label>
<div class="trend-button">
#ACTIONS#
</div>
<input type="radio" id="option4" name="menu-option">
<label for="option4">#H4#<div class="subtitle">#S4#</div></label>
<div class="trend-button">
#ACTIONS#
</div>
</div>
For context something like this
2
Answers
I’ve made some modifications to your code. Perhaps these changes could be beneficial for you. You can find the updated code here: https://play.tailwindcss.com/moSic3xHZM.
Adjust the
bottom
property for more space below the button.