简体   繁体   English

Chrome会完美加载网页,其他所有浏览器均会失败。 为什么?

[英]Chrome loads the webpage perfectly, every other browser fails. Why?

I wrote an HTML page where I needed to embed certain sections of an image with hyperlinks. 我写了一个HTML页面,需要在其中嵌入带有超链接的图像的某些部分。 For this I used SVG tags so that I don't have to use image map tags, since they cannot scale well with the screen. 为此,我使用了SVG标签,因此不必使用图像地图标签,因为它们无法在屏幕上很好地缩放。

This is what the page looks like in chrome 这是Chrome网页的外观 在此处输入图片说明

<svg id="mySVG" style="width:100%;height:100%;" version="1.1" viewbox="0 0 2000 2000" xmlns="http://www.w3.org/2000/svg">
    <image style="width:inherit;height:inherit;" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Image URL">
    </image>
        <a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Image URL">
            <circle cx="45%" cy="33%" r="120" stroke="black" stroke-width="3" opacity="0" fill="#fff">
            </circle>
        </a>    
        .
        .
        //More <a> tags representing the various clickable points in the image
        .
        .
        .
</svg>

Basically the image in the IMAGE tags don't load and the screen takes the color of the background. 基本上,不会加载IMAGE标签中的图像,并且屏幕采用背景色。 I know that chrome is much more lenient with the rules but I don't think I have made any errors. 我知道chrome对规则的宽容得多,但我认为我没有犯任何错误。 This code works perfectly well with Chrome, but in any other browser, the images don't load. 这段代码可与Chrome完美配合,但在任何其他浏览器中,图像均不会加载。 The image links like 'Wallpaper', 'Button', 'poster' although open separately in new tabs if I click the point in the paper where they are supposed to be but otherwise they don't work. 图像链接,如“墙纸”,“按钮”,“海报”,尽管如果我在纸张中单击它们应该位于的位置,但会在新选项卡中单独打开,否则它们将不起作用。

An SVG <image> tag must have width and height attributes in SVG 1.1, CSS properties are not allowed. SVG <image>标签在SVG 1.1中必须具有width和height属性,不允许CSS属性。

Chrome is experimenting with implementing SVG 2 CSS Properties for width and height which is why it works there. Chrome浏览器正在尝试实现SVG 2 CSS属性的宽度和高度,这就是它在那里工作的原因。 The SVG 2 specification is unfinished and no other UA currently implements this feature. SVG 2规范尚未完成,并且当前没有其他UA实现此功能。 I imagine as the specification nears completion more UAs will implement this functionality though. 我想随着规范即将完成,更多的UA将实现此功能。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AJAX没有在chrome中显示,其他所有浏览器都没问题 - AJAX not displaying in chrome, every other browser is fine 我的字体在Chrome上加载,但在Firefox或任何其他移动浏览器上不加载 - My font loads on Chrome but not in Firefox or any other mobile browser 为什么iOS Safari(和iOS Chrome)显示背景图像与其他浏览器不同? - Why is iOS Safari (and iOS Chrome) displaying background-image's differently to every other browser? 在web.config中注册自定义控件失败。 为什么? - Registering custom control in web.config fails. Why? 为什么该动画在chrome浏览器之外的所有浏览器上都能正常工作? (有前缀) - Why is this animation working on every browser but chrome ? (has prefixes) 使用css背景图片的浏览器问题,在Chrome中无法完美显示 - Browser issue with css background image, not showing perfectly in Chrome 在哪种情况下,网页加载时没有使用Chrome或Safari的外部样式表? - In which case webpage loads without external stylesheet in chrome or safari? onDeviceReady()有效,但document.addEventListener(“ deviceready”,onDeviceReady(),false); 失败。 为什么? - onDeviceReady() works but document.addEventListener(“deviceready”, onDeviceReady(), false); fails. Why? 为什么浏览器先加载HTML,然后加载Bootstrap? - Why Browser Loads first HTML Then Bootstrap? 为什么链接在 Internet Explorer 中可以完美运行,而在 google Chrome 中却不能 - Why link working perfectly in Internet explorer but not in google Chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM