All Questions

165
votes
12answers
92938 views

jquery's append not working with svg element?

Assuming this: <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("svg").append(...
233
votes
5answers
202309 views

Convert SVG to image (JPEG, PNG, etc.) in the browser

I want to convert SVG into bitmap images (like JPEG, PNG, etc.) through JavaScript.
352
votes
12answers
474571 views

How to change color of SVG image using CSS (jQuery SVG image replacement)?

This is a self Q&A of a handy piece of code I came up with. Currently, there isn't an easy way to embed an SVG image and then have access to the SVG elements via CSS. There are various methods of...
44
votes
3answers
31521 views

Transparent arrow/triangle indented

I would like to make a transparent arrow over an image. This triangle should be indented in a block and show the background image. Desired output: CSS: .barShow { background-color: #000; ...
126
votes
3answers
130660 views

Fill SVG path element with a background-image

Is it possible to set a background-image for an SVG <path> element? For instance, if I set the element class="wall", the CSS style .wall {fill: red;} works, but .wall{background-image: url(wall...
253
votes
15answers
92307 views

jQuery SVG, why can't I addClass?

I am using jQuery SVG. I can't add or remove a class to an object. Anyone know my mistake? The SVG: <rect class="jimmy" id="p5" x="200" y="200" width="100" height="100" /> The jQuery that wo...
92
votes
2answers
58542 views

How to apply a style to an embedded SVG?

When an SVG is directly included in a document using the <svg> tag, you can apply CSS styles to the SVG via the document's stylesheet. However, I am trying to apply a style to an SVG which is em...
419
votes
8answers
374090 views

Do I use <img>, <object>, or <embed> for SVG files?

Should I use <img>, <object>, or <embed> for loading SVG files into a page in a way similar to loading a jpg, gif or png? What is the code for each to ensure it works as well as pos...
498
votes
12answers
280497 views

PNG vs. GIF vs. JPEG vs. SVG - When best to use?

When should certain image filetypes be used when building websites or interfaces, etc? What are their points of strength and weakness? I know that PNG & GIF are lossless, while JPEG is lossy. Bu...
73
votes
11answers
52485 views

Transparent text cut out of background

Is there any way to make a transparent text cut out of a background effect like the one in the following image, with CSS? It would be sad to lose all precious SEO because of images replacing text. ...

Previous Next