SVG objects vs div layers

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7649
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

SVG objects vs div layers

Post by Isaac »

❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7649
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: SVG objects vs div layers

Post by Isaac »

Image
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6511
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: SVG objects vs div layers

Post by Jeff250 »

Right, I do know that IE9 is the first IE to support svg without plugins, which is a pretty bad situation for Web developers. The rest of browsers have supported it for a while.

While svg's are cool, before you alienate most IE users, think about why you would want to use svg's, e.g., what benefit would they have on your Web site versus converting them to png's. For instance, vector graphics have infinite resolution, but is that really important for an image on a Web page? Also, keep in mind that not everyone uses IE by choice, e.g., a lot of people are forced to use it at work where they don't have permission to install a better browser.

Where I see svg's mostly used on the Web is for plots and diagrams, i.e., optional features where people who can't see svg's are just missing a small feature in your Web site.

One idea you might want to try is to use the <object> tag for the svg and then put an <img> tag inside of it for fallback. I don't know how well this works in practice, although it should work in theory... I've never actually had a good reason to use svg's yet.
User avatar
Sirius
DBB Master
DBB Master
Posts: 5616
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Re: SVG objects vs div layers

Post by Sirius »

It depends.

If you're doing it for yourself, you decide what your priorities are. If you want to use SVG, that's up to you, and not too horrible.

If you're doing it for customers, the aim of the game is to make things simpler for them, not you. People can and do turn away from sites if it requires extra effort from them to look at, even if they have the ability to modify/update their browser. Luckily, this rarely means you need to support IE6 any more, and 7 is even less popular, but 8 is still in the mix.
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6511
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: SVG objects vs div layers

Post by Jeff250 »

Especially since XP users can't upgrade to IE9.

My personal policy is to only support browsers that still receive security updates. If $BROWSER_VENDOR doesn't support their browser, then why should I? Sadly, this means that IE6 won't truly die until 2014 when XP reaches end of life. But support means that the meat of the site works, but maybe not all of the gravy. Say, if your site has an eclectic feature where it can dynamically generate some cool svg plots of some data that only a few people would want to look at anyways, then that's a good excuse to not support an older browser. No reason to exclude people from a cool but optional feature just to appeal to the lowest common denominator.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7649
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: SVG objects vs div layers

Post by Isaac »

Sirius and Jeff, thank you!


Google Analytics shows IE users rarely went to my site, in comparison to other browsers, in the last two years, even when it was designed primarily for them, though it was highest at the start of 2009.


Since I'm still very new to web code, I'll only worry about IE9, Chrome, and FF, while I learn. Older, more complicated, browsers will be a lower priority.

Thanks again.

edit:
I could add,

"Sorry, your browser requires very special and very specific coding to function, not shared by other browsers. This site is made for browsers that are allow more commonly used code, like the latest builds of Chrome, Opera, Safari, Firefox, and Internet Explorer. I might later make a special version of my site just for your special browser, but I don't know when."



edit:

of course, if I ever make a site for someone else, Jeff, I will have to use your advice and method of decision making, regarding compatibility.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Post Reply