英文:
Font style doesn't change in my website with the Chrome setting?
问题
如果我在Chrome中更改默认的显示字体设置(设置 > 外观 > 自定义字体),选择除默认字体以外的任何字体,我的网页不会显示字体更改。
应该看起来像默认/更改后的(Times New Roman/Cascadia Code):
尽管字体设置已更改,但页面的字体不会改变。
英文:
If I change the default display font settings in Chrome (Settings > Appearance > Customise fonts) to anything different but default. My webpage does show the change in font.
How it should look like Default/Changed (Times New Roman/Cascadia Code):
Example of a font change on Wikipedia
The font of the page does not change despite changed settings for the font.
答案1
得分: 1
网页的字体由页面的HTML代码中定义的CSS样式确定。更改浏览器中的默认字体设置仅影响浏览器的UI元素所使用的字体,而不影响网页的字体。
要更改网页的字体,您需要更新该页面的CSS样式,以使用所需的字体。这可以通过将font-family属性添加到您想要更改字体的元素的CSS样式中来完成。
英文:
The font of a webpage is determined by the CSS styles defined in the HTML code of the page. Changing the default font settings in your browser only affects the font used for the UI elements of the browser and not for the webpages.
To change the font of a webpage, you need to update the CSS styles for that page to use the desired font. This can be done by adding a font-family property to the CSS styles for the elements you want to change the font for.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论