Home > Web Front-end > HTML Tutorial > 如何在谷歌浏览器下设置小于12px的字体_html/css_WEB-ITnose

如何在谷歌浏览器下设置小于12px的字体_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:32:22
Original
1643 people have browsed it

如果在谷歌浏览器下设置小于12px的字体:
建议:尽可能的手写代码,可以有效的提高学习效率和深度。
在谷歌浏览器有一个由来已久的问题,那就是无法设置小于12px字体,就算是设置了小于12px的字体也只会显示12px大小。
先看一段代码实例:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">ul{  list-style:none;}.first{  font-size:16px;  }.second{  font-size:14px;  }.third{  font-size:12px;  }.fourth{  font-size:10px;  }</style></head><body><ul>  <li class="first">16px</li>  <li class="second">14px</li>  <li class="third">12px</li>  <li class="fourth">10px</li></ul></body></html>
Copy after login

以上代码在谷歌浏览器中并不能将字体大小设置为10px。下面就对上面的代码进行一下修改:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">html,body{  -webkit-text-size-adjust:none;}ul{  list-style:none;}.first{  font-size:16px;  }.second{  font-size:14px;  }.third{  font-size:12px;  }.fourth{font-size:10px;  }</style></head><body><ul>  <li class="first">16px</li>  <li class="second">14px</li>  <li class="third">12px</li>  <li class="fourth">10px</li></ul></body></html>
Copy after login

以上代码实现了将字体大小设置为10px的功能。核心是添加了如下代码:

html,body{  -webkit-text-size-adjust:none;}
Copy after login

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=3375

更多内容可以参阅:http://www.softwhy.com/divcss/

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template