css27】base標籤帶有href屬性會讓chrome裡的svg元素url失效

來源:互聯網
上載者:User

標籤: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>

 

具體原因不明,希望有大神賜教。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.