flocosix Posted September 20 Share Posted September 20 Site URL: https://www.orientare.md/principala-exp-simple Hi! I need to change the font sizes on Instagram browser specifically, because by default it makes them TOO big (larger than on any other mobile browser). How can I control this with code? Need it to simply control font size of h1, h2, h3...etc and paragraph text as well. Thanks! Link to comment
Solution flocosix Posted September 20 Author Solution Share Posted September 20 (edited) Solution: 1. Add this code as a code injection: if (navigator.userAgent.includes('Instagram')) { document.body.classList.add('instagram-browser'); } 2. use .instagram-browser before any CSS code you want to apply only to instagram visits. You're welcome. Example: /* Custom styles only for Instagram's in-app browser */ .instagram-browser h1 { font-size: 32px !important; /* Adjust size for h1 */ } .instagram-browser h2 { font-size: 25px !important; /* Adjust size for h2 */ } .instagram-browser h3 { font-size: 20px !important; /* Adjust size for h3 */ } .instagram-browser h4 { font-size: 18px !important; /* Adjust size for h4 */ } .instagram-browser .sqsrte-large { font-size: 16px !important; /* PARAGRAPH 1 */ } .instagram-browser p:not(.sqsrte-large):not(.sqsrte-small) { font-size: 12px !important; /* PARAGRAPH 2 */ } .instagram-browser .sqsrte-small { font-size: 11px !important; /* PARAGRAPH 3 */ } /* Custom styles only for Instagram's in-app browser - CONTENT TITLE */ .instagram-browser h2.list-item-content__title { font-size: 5vw !important; /* Content TITLE SIZE */ } This customizez all text types + titles. Edited September 20 by flocosix Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment