Created
April 11, 2022 15:29
-
-
Save erickarbe/44e8145899d0476d2c6c164282ef37b2 to your computer and use it in GitHub Desktop.
How to add custom css to a square website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var parentWindow = window.parent; | |
// Create our stylesheet | |
var style = parentWindow.document.createElement('style'); | |
style.innerHTML = `#YOUR_SELECTOR_HERE {max-width: 100% !important; padding: 0; overflow: hidden; }`; | |
// Get the first script tag | |
var ref = parentWindow.document.querySelector('script'); | |
// Insert our new styles before the first script tag | |
ref.parentNode.insertBefore(style, ref); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment