Вы находитесь на странице: 1из 2
28015 SVG ann tag teks SVG and tag tricks Alexey Ten, August 16, 2013 A few days ago Lea Verou shared a link to Jake Archibald's post Having fun with where he once again found out that image and img are nearly the same, all browsers replace image with img while parsing HTML. A couple of months ago this property of image svg.svg _svg.png tag gave me the idea to use it for graceful degradation of SVG images in browsers which do not support SVG. The idea is extremely simple, we will have a SVG image for moder browsers and regular raster image for others. And write the following code: 96" ‘svg.png" widt! And here the magic: browsers which support SVG will read the code as: svg.svg" widtl ignoring src attribute and will show SVG image, Browsers which do not support SVG will ignore unknown tag svg and thanks to image is replaced with img will read the code as: and will show regular image. For very simple images (e.g. icons), it is possible not to create a separate SVG file, just write all the content in HTML, that could be shorter than the file path. yer rufexamplessvglon Hl 42 28015 SVG ann tag teks Example: le v ah yer rufexamplessvglon Hl 22

Вам также может понравиться