Currently, I am utilizing the querySelector method to modify the styling of specific elements.
In certain cases, different browser versions require separate stylings. For example, using fit-content
for Chrome and -moz-fit-content
for Mozilla.
If I wish to cater to both browsers, my code would look like this:
document.querySelector('.my-element').style.height = "fit-content";
document.querySelector('.my-element').style.height = "-moz-fit-content";
By combining these lines of code, I hope to achieve compatibility for both Chrome and Mozilla.