So, I’ve tried to make my website a little more mobile friendly by making the font size in the “<main>” increase if “navigator.userAgent” contains the string “Mobile”. It appears to work as expected in Firefox on Android and in the Android Stock Browser. However, in Mobile Safari, it appears to work only on some pages on my site, while the same part of the script appears to be ignored on others (despite working in Firefox and in Android Browser). Also, in Chrome, the layout gets completely broken when that part of the script is run. You can see my website here (right now, I’ve added some browser-sniffing not to run that part of the script in mobile Chrome):
Did anyone else here have a similar problem? I suppose it has something to do with the fact that mobile Chrome automatically tries to make non-mobile sites mobile-friendly by increasing the font size of some parts of the web-pages, and possibly also that there is some error in my CSS (which I am not so good at).
Please be polite, I’m 18 and I’ve been trying to learn how to program for only five years now, and this is my first website.