Home > Web Front-end > HTML Tutorial > css27] The base tag with href attribute will invalidate the svg element URL in chrome_html/css_WEB-ITnose

css27] The base tag with href attribute will invalidate the svg element URL in chrome_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:00:56
Original
1614 people have browsed it

A chrome problem, but the specific cause is unknown.

Trigger condition: When the href attribute in the base tag of the chrome browser has a value

Trigger problem: If the element in svg has a url Filters and blur will fail. This problem is not found in Firefox and IE10.

Normal state:

When there is a base tag and the value in href is ".", the state in chrome:

Test code:

<!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>
Copy after login

The specific reason is unknown, I hope someone can help me Give me some advice.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template