javascript - SVG字體在低版本chrome和移動(dòng)端的縮放問(wèn)題。
問(wèn)題描述
在360極速等低版本殼瀏覽器和移動(dòng)端瀏覽器中,svg中<tspan>標(biāo)簽中的字體無(wú)法正確縮放,在最新版本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>
當(dāng)窗口縮小時(shí),極速瀏覽器中字體大小縮放到12px就不會(huì)縮小了。最新chrome中正常。如果打開(kāi)360極速的調(diào)試工具,把display:block屬性去掉就正常縮放了。但直接在css中設(shè)置display:inline也不行。好奇怪。
問(wèn)題解答
回答1:只要給svg設(shè)置樣式 text-rendering='geometricPrecision' 就好了。
相關(guān)文章:
1. mysql - 這種分級(jí)一對(duì)多,且分級(jí)不平衡的模型該怎么設(shè)計(jì)表?2. javascript - vue-cli npm run build編譯報(bào)錯(cuò)3. python - Scrapy ItemLoader數(shù)據(jù)清洗疑問(wèn)4. PHP類(lèi)屬性聲明?5. javascript - Object.define 可以監(jiān)聽(tīng)object變化,那基本類(lèi)型變量如何監(jiān)聽(tīng)6. css - div外層有一圈白色7. atom開(kāi)始輸入!然后按tab只有空格出現(xiàn)沒(méi)有html格式出現(xiàn)8. javascript - js setTimeout在雙重for循環(huán)中如何使用?9. python - pip install出現(xiàn)下面圖中的報(bào)錯(cuò) 什么原因?10. javascript - vue 2.0 :key的作用
