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. css3 - [CSS] 动画效果 3D翻转bug2. dockerfile - [docker build image失败- npm install]3. python - pandas按照列A和列B分组,将列C求平均数,怎样才能生成一个列A,B,C的dataframe4. java - Tomcat 不同的域名访问同一个项目的不同网页5. docker gitlab 如何git clone?6. docker-machine添加一个已有的docker主机问题7. docker安装后出现Cannot connect to the Docker daemon.8. 使用mysql自增主键遇到的问题9. docker不显示端口映射呢?10. javascript - IOS微信audio标签不能通过touchend播放
