问题
I want the font in my navigation bar to be a fixed size - not affected by browser font size changes. I'm totally fine with the rest of the text being fluid but the design of my site is such that i need the nav bar text to remain the same size no matter what.
Here is an example of what i would LIKE to do. Don't know how this was done. The nav bar on the top right is unaffected by font size increase/decrease. If someone could clue me in it would be greatly appreciated! :)
http://studiogang.net/
Also, I don't want to use an image instead, because the dropdown menu i want won't work with image mapping. Or at least, i'd rather not go down that road.
回答1:
<ul id="navbar" style="font-size:14px">
</ul>
回答2:
You can try using text-size-adjust:
-webkit-text-size-adjust:none;
-ms-text-size-adjust:none;
-moz-text-size-adjust:none;
text-size-adjust:none;
It only works on mobile though.
Apart from that I think the only option is to make your layout working well on different zoom levels.
回答3:
Try using pixels for the font size.
来源:https://stackoverflow.com/questions/19918286/how-to-set-a-fixed-font-size-prevent-browser-scaling-for-a-specific-single-elem