homepage Welcome to WebmasterWorld Guest from 54.196.201.253
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
HTML decimal alternative
When the decimal isn't recognized by the browser
GoNC




msg:4682562
 3:04 am on Jun 25, 2014 (gmt 0)

When I last designed my site, I tried to minimize the use of images for the sake of speed. In doing so, I used several HTML decimal entities that I thought were universal, like:

►
▼

I recently discovered, though, that these aren't showing up in mobile browsers; all the user is seeing is an empty square.

I'd rather not replace these with images to do the same thing. I could realistically replace them with plain text (eg, ► becomes >), but I don't want to do that on all browsers for aesthetic purposes; I'd rather it be a last resort.

I could also replace them with pure CSS, but that's a lot of code to replace 7 little digits! LOL

Any other suggestions on how I might handle this?

 

Fotiman




msg:4682568
 3:22 am on Jun 25, 2014 (gmt 0)

Using Icon Fonts.

[css-tricks.com...]

lucy24




msg:4682586
 5:11 am on Jun 25, 2014 (gmt 0)

It's got nothing to do with recognizing entities. Mobiles simply don't come with as many fonts. If you require something that isn't built in, your only option is font embedding. Mobiles do seem to be OK with this; I had to do it on iOS 4 to get my non-English text to display.

decimal 9658, 9660
= hex 25ba, 25bc
= what the bleep? Can't you just use pointing fingers or something more widely available instead?

:: pause to swear at whatever idiot saw fit to destroy the Font Variation aspect of Character Viewer in 10.9 ::

If you need to embed a font, find a small one. Users on slower connections won't thank you if they have to download a 300k font file just to view a 10k page. Yes, there are single-glyph options, but it involves going to a third party. (Got a nasty feeling it's G###. I mean, who else would it be?) I prefer to edit font files so I'm just embedding the parts that are actually used.

GoNC




msg:4682645
 8:11 am on Jun 25, 2014 (gmt 0)

Heck, I'm just using an Arial font! I thought it was universal, but I get squares on both iPhone's Safari, iPhones Google, and my default Android browser (whatever it is) :-(

I wish I'd realized this little issue earlier, but it didn't even cross my mind that mobile browsers wouldn't recognize it. I bet I have these two decimals in 250 different places throughout the site. Grr.

lucy24




msg:4682664
 10:06 am on Jun 25, 2014 (gmt 0)

You may be using Arial for body text, but that doesn't mean every single character on every page is Arial. Your browser uses Font Substitution to find characters in other fonts when needed.

:: detour to detestable new Character Viewer ::

Those triangles are in Arial Unicode, but not vanilla Arial. (On my computer there are six Arials all told.) Also in Apple Symbols. The down-pointing one seems to have wider support.

:: further detour to test site and iPad ::

Both triangles display on iOS 7. (At a guess, using Apple Symbols.) Are your mobiles reasonably up-to-date?

GoNC




msg:4682942
 1:44 am on Jun 26, 2014 (gmt 0)

Well, I made a discovery earlier today; changing ▼ to ▼ works on all of the browsers I could test with. So this must be an encoding issue.

lucy24




msg:4682960
 4:14 am on Jun 26, 2014 (gmt 0)

I'll be damned. I had no idea any browser distinguished between decimal and hexadecimal entities. I normally do use hexadecimal-- on the rare occasions I have to use entities at all-- but that's just because Character Viewer uses hexadecimal so it saves a step.

:: file and remember ::

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved