Skip to main content

Deprecated Code - Why You Should Avoid It

If you're perusing one of my articles on blog coding, for instance Centering Complex and Multiple Objects, and you follow my advice to read the W3 Schools tutorials for further advice, you'll find a lot to read. They give you good canonical definitions of each HTML tag, and interactive exercises so you can see what each one actually does.

If you're reading about the <center> tag, you'll note the advice
The center element was deprecated in HTML 4.01.
The center element is not supported in XHTML 1.0 Strict DTD.

If you're not blocking popups from http://www.w3schools.com, you'll note a popup window advising you that
A deprecated element or attribute is one that has been outdated.
Deprecated elements may become obsolete in the future, but browsers should continue to support deprecated elements for backward compatibility.

In other words, you can keep using <center> ... </center> right now, but one day in the future, it may stop working. No guarantee when, either.

In HTML, an element is deprecated only when there is a replacement for it. In this case, this is a good replacement. The <center> ... </center> tags are known to display differently in Firefox and Internet Explorer.

For <center> ... </center>, you're advised
Use CSS styles to center text!

I use
<span style="text-align:center;"> ... </span>
to center text, for instance. You can use the
<span> ... </span>
pair within a paragraph, or wherever else convenient. And if you want to center graphic objects, or multiple text objects, relative to each other, you can use nested tables.

>> Top

Comments

Mary said…
Good to know! Thanks!

Popular posts from this blog

Embedded Comments And Main Page View

The option to display comments, embedded below the post, was made a blog option relatively recently. This was a long requested feature - and many bloggers added it to their blogs, as soon as the option was presented to us. Some blog owners like this feature so much, that they request it to be visible when the blog is opened, in main page view. I would like all comments, and the comment form, to be shown underneath the relevant post, automatically, for everyone to read without clicking on the number of comments link. And this is not how embedded comments work.

What's The URL Of My Blog?

We see the plea for help, periodically I need the URL of my blog, so I can give it to my friends. Help! Who's buried in Grant's Tomb, after all? No Chuck, be polite. OK, OK. The title of this blog is "The Real Blogger Status", and the title of this post is "What's The URL Of My Blog?".

With Following, Anonymous Followers Can't Be Blocked

As people become used to Blogger Following as just another tool to connect people, they start to think about the implications . And we see questions like How do I block someone who's been following my blog secretly? I couldn't see her in my Followers list (hence I couldn't use the "Block this user" link), but I have looked at her profile and could see that she's Following my blog. Following, when you look at the bottom line, is no more than a feed subscription and an icon (possibly) displayed on your blog, and linking back to the profile of the Follower in question. If someone Follows your blog anonymously, all that they get is a subscription to the blog feed. If you publish a feed from your blog, and if the feed is open to anybody (which, right now, is the case ), then it's open to everybody. If someone wants to use Following to subscribe to the feed, you can't stop this. You can't block it before, or after, the fact. You can't Block w