Html code element visible while unchecked visibility

I use the shopify buy button sales channel code to display a product with the add to cart button and also to add the checkout functionality within to my webshop. This is a code example:


In order to translate texts in this code, I placed two html elements with this kind of code, one in dutch and one in german. Now when I uncheck one html code for visibility (and then solve the issue with css), it still appears, told me the problem is in the codes. On the other hand I use weglot to translate this code, because the code is within an iframe, I would need another option to fully translate it, hence the css. Can anyone help me out to solve this?