標籤:style blog http color strong io 2014 問題
一個chrome的問題,但具體原因不明。
觸發條件:chrome瀏覽器base標籤裡href屬性有值的時候
觸發問題:svg裡面的元素如果有用url的濾鏡和模糊,則會失效,在firefox裡和IE10沒有發現這個問題。
正常狀態:
有base標籤且href裡值為“.”的時候chrome裡的狀態:
測試代碼:
<!doctype html><html><head><meta charset="utf-8"><title>chrome bug</title><style>#svg{ width:500px; height:500px; display:block; margin:20px auto; background-color:#000; }</style><!--當href=""裡面有值的時候填寫的url都會失效--><base href="." target="_blank"><!--當href=""這樣則不會--><!--<base target="_blank">--></head><body><svg id="svg"><defs><lineargradient id="blur1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:#FF0000;stop-opacity:0"></stop> <stop offset="100%" style="stop-color:#FF0000;stop-opacity:1"></stop></lineargradient><filter id="Gaussian_Blur"><feGaussianBlur in="SourceGraphic" stdDeviation="3" /></filter></defs><circle cx="200" cy="50" r="40" style="stroke:url(#blur1); filter:url(#Gaussian_Blur); stroke-width:10; fill:yellow; "/><line x1="0" y1="0" x2="300" y2="300" style="stroke:url(#blur1); stroke-width:2;" /></svg></body></html>
具體原因不明,希望有大神賜教。