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: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

SVG objects vs div layers

Post by Isaac » Mon Jun 06, 2011 2:53 pm

s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: SVG objects vs div layers

Post by Isaac » Mon Jun 06, 2011 6:41 pm

Image
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6387
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: SVG objects vs div layers

Post by Jeff250 » Mon Jun 06, 2011 10:26 pm

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: 5437
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Re: SVG objects vs div layers

Post by Sirius » Mon Jun 06, 2011 10:34 pm

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: 6387
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: SVG objects vs div layers

Post by Jeff250 » Mon Jun 06, 2011 10:53 pm

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: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: SVG objects vs div layers

Post by Isaac » Tue Jun 07, 2011 6:04 am

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.
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
Post Reply