javascript - SVG字體在低版本chrome和移動(dòng)端的縮放問題。
問題描述
在360極速等低版本殼瀏覽器和移動(dòng)端瀏覽器中,svg中<tspan>標(biāo)簽中的字體無法正確縮放,在最新版本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中正常。如果打開360極速的調(diào)試工具,把display:block屬性去掉就正常縮放了。但直接在css中設(shè)置display:inline也不行。好奇怪。
問題解答
回答1:只要給svg設(shè)置樣式 text-rendering='geometricPrecision' 就好了。
相關(guān)文章:
1. node.js - mysql如何通過knex查詢今天和七天內(nèi)的匯總數(shù)據(jù)2. shell - Update query wrong in MySQL3. javascript - 用jsonp抓取qq音樂總是說回調(diào)函數(shù)沒有定義4. mysql 插入數(shù)值到特定的列一直失敗5. mysql 怎么做到update只更新一行數(shù)據(jù)?6. javascript - 新浪微博網(wǎng)頁版的字?jǐn)?shù)限制是怎么做的7. 怎么在網(wǎng)頁中設(shè)置圖片進(jìn)行左右滑動(dòng)8. 360瀏覽器與IE瀏覽器有何區(qū)別???9. sublime可以用其他編譯器替換嗎?10. python - 在使用Pycharm時(shí)經(jīng)常看到如下的樣式,小括號(hào)里紅色的部分是什么意思呢?
