/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] HTML 5 and character codes

Why is it necessary to code the following characters in HTML 5? They both display correctly in all the major browsers without the code. Is it just to satisfy W3C Validation?

[code]– &[/code]

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@rtretheweyApr 10.2014 — Don't look at this as simply what works. Look at it in terms of best practice. HTML entities are really necessary in a couple of instances (like query strings), but browsers will always try to render whatever you put on a page.

So you can often get away with very sloppy code until the situation arises when it actually starts to cause a problem. By always sticking to the standards, you insure that all users see your pages the way you intend, and automated systems (like in blog templates or when search engine robots crawl your site) won't have any trouble with them either. A little extra effort up front can save you a lot of trouble in the future.
Copy linkTweet thisAlerts:
@Sup3rkirbyApr 10.2014 — I guess I wouldn't say that currently it's necessary, but only because all modern browsers still support older versions/specs of HTML. It's the same with a number of other deprecated tags and attributes that still work.

It's more about following the standards of the most recent version of HTML. Eventually browsers will start removing support for older things and thus sites that use them will run into some issues (like looking at sites from the 90s today).
Copy linkTweet thisAlerts:
@jwgrafflinauthorApr 10.2014 — Thanks for clarification. What prompted my inquiry is remote ad code for advertising networks like 7Search and Chitika. They do not follow standards. In fact, some still use "script type" and "script language," as well as the ampersand and whitespace in id tags (which drives the validator crazy). I strive to always follow the standards. And when in doubt, I come here.
×

Success!

Help @jwgrafflin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...