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. boot2docker無(wú)法啟動(dòng)2. docker-compose中volumes的問(wèn)題3. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””4. nignx - docker內(nèi)nginx 80端口被占用5. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.6. javascript - mock.js可以存儲(chǔ)數(shù)據(jù)嗎7. java - SSH框架中寫(xiě)分頁(yè)時(shí)service層中不能注入分頁(yè)類(lèi)8. golang - 用IDE看docker源碼時(shí)的小問(wèn)題9. docker api 開(kāi)發(fā)的端口怎么獲取?10. dockerfile - 為什么docker容器啟動(dòng)不了?

網(wǎng)公網(wǎng)安備