javascript - SVG字体在低版本chrome和移动端的缩放问题。
问题描述
在360极速等低版本壳浏览器和移动端浏览器中,svg中<tspan>标签中的字体无法正确缩放,在最新版本Chrome中正常。
<!DOCTYPE html><html lang='en'><head> <meta charset='UTF-8'> <style>tspan{ display: block;} </style></head><body><p> <svg viewBox='0,0,1000,1000' version='1.1' xmlns='http://www.w3.org/2000/svg'><text><tspan y='55.9' x='5.5'>After all the articles, ads, fliers, etc. have been prepared for the newsletter, the document should be assembled and may require </tspan></text> </svg></p></body></html>
当窗口缩小时,极速浏览器中字体大小缩放到12px就不会缩小了。最新chrome中正常。如果打开360极速的调试工具,把display:block属性去掉就正常缩放了。但直接在css中设置display:inline也不行。好奇怪。
问题解答
回答1:只要给svg设置样式 text-rendering='geometricPrecision' 就好了。
相关文章:
1. vue.js - vue 打包后 nginx 服务端API请求跨域问题无法解决。2. android - webview 自定义加载进度条3. jupyter-notebook - Mac下启动jupyter notebook后没有Python的选项?4. html5 - 求详解h5 video事件监听5. Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?6. 输入地址报以下截图错误,怎么办?7. javascript - vue更改当前节点元素8. angular.js - angular post的Content-Type被设置,导致不能上传图片,求助!!9. css3 - 这个效果用 CSS 可以实现吗?border-image10. android - react-native 在genymotion中一直连不上server

网公网安备