I've gone through numerous articles on this issue, but I'm still unable to resolve it. My goal is simply to eliminate the padding that bootstrap automatically adds around the mark tag. This is important because I am dynamically changing highlights as the user types, and the text shifting can be quite disruptive.
Below is a snippet from my App.css file:
mark .query{
padding: 0em;
padding-left: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-top: 0px;
}
Here is a section of the React code where highlighting occurs (utilizing Highlighter):
<Highlighter
highlightClassName="query"
searchWords={[this.props.query]}
autoEscape={true}
textToHighlight={result}/>
This is what gets rendered by React in HTML form:
<mark class="query ">Text</mark>
Into my project, I have imported CSS files for both Bootstrap and my custom styles:
import 'bootstrap/dist/css/bootstrap.min.css';
import './App.css';
Lastly, here are the computed styles reflecting the current situation:
https://i.sstatic.net/rnSVy.png
It's becoming quite frustrating! :)