How to automatically remove CSS properties on loading a page

Viewed 103

There is this site, which starts flickering as soon as I visit it, removing the margin:0; property helps, but others are not facing this issue( They have the margin:0 property too, we use the same browsers ). Is there any way to automatically remove that property every time I visit the site?

2 Answers

I would use a browser plugin to insert the JavaScript code for the specific site. It's an easy and flexible way to run the script that you want. Sometimes I use it to remove specific parts from a website that I'm not interested in.

For example you could use the TamperMonkey browser plugin to do it. It's available for Chrome, Firefox Microsoft Edge, Safari, Opera Next. You can download it here: https://www.tampermonkey.net/

There's a FAQ available if you have some additional questions about how to use it: https://www.tampermonkey.net/faq.php?ext=dhdg#Q102

<script>
    const bodys = document.querySelector('body');
    bodys.style.removeProperty("margin");
</script>

you can use the above javascript to remove margin or any other CSS property. you have to replace body with your tag or class (.classname).

Related