I have the following CSS:
.subtask {
background: var(--offwhite-color);
margin: 0.3em;
padding: .625em 1.25em;
width: 60%;
margin-left: .9em;
}
.subtask.highlight {
border-left: .3em solid var(--secondary-color);
}
where .subtask.highlight
is only rendered onClick()
. However, this extends the width past the fixed width compared to when the .highlight
wasn’t rendered. I’d like the width to stay the same, but add the border as is on the left side. How can I accomplish this?
Looking in dev tools, it seems like none of my specifications are being overriden, so I’m wondering what’s going on.
2
Answers
Try to add transparent border to subtask class
Try to add box-sizing: border-box;