homepage Welcome to WebmasterWorld Guest from
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

This 49 message thread spans 2 pages: 49 ( [1] 2 > >     
Warning: Deprecated HTML Tags and Attributes
goodbye to <center>, <font>, align=

 10:58 pm on Apr 8, 2002 (gmt 0)

It's the big HTML clean-up. The W3C is removing presentational elements that were introduced in HTML 3.2 and moving those functions over to stylesheets. So the HTML ground is shifting under our feet, and many of our old tag and attribute friends are going to be leaving us.

I thought it would be useful to list the deprecated HTML tags and attributes, and deal with any related issues. CSS will take care of most.

If I'm missing anything, please help me fill out the list. At the very least, I can stop writing deprecated code. Patch-ups will come a bit later.

Deprecated Tags
<applet> - use <object>
<dir> - use <ul>
<isindex> - use <input>
<listing> - use <pre>
<menu> - use <ul>
<plaintext> - use <pre>
<s> - use <del>
<strike> - use <del>
<xmp> - use <pre>

Deprecated Attributes

Also, width= and height= are deprecated attributes for <td> elements [w3.org]. The recommendation is to define width for <table>, and let the browser sort out the individual cells.

<edited to fix formatting>

[edited by: tedster at 4:35 am (utc) on Mar. 23, 2005]



 11:06 pm on Apr 8, 2002 (gmt 0)

The recommendation is to define width for <table>, and let the browser sort out the individual cells.

BWAHAHAHAHaaaaa.... ::whimper:: They've got to be kidding. Oh, that's ugly... and deprecating "align=" which was the only reliable way I knew of to center anything? The least they could do is wait until a reliable replacement comes along before deprecating something.

::sigh:: I guess I'll finally stop using font tags for colored text, and start using classes instead. Yes, I'm marching towards full CSS, stumbling and tripping along the way though I may be...


 11:58 pm on Apr 8, 2002 (gmt 0)

Not to worry, the browser support for these basics is pretty solid, even in NN4. The problems with CSS come when you get into the things HTML never did anyway.

<My Wish: IE, please don't render dotted borders as dashed borders in your next version, OK?>

brotherhood of LAN

 12:01 am on Apr 9, 2002 (gmt 0)

Great heads up tedster, thankfully ive just changed all my site getting rid of most of my probs! That centre one is a bit of a downer though

what about bgcolor...does this mean cells will have to be replaced with repeating 1x1 gifs???


 12:30 am on Apr 9, 2002 (gmt 0)

CSS allows you to set bgcolor and background images for divs...

I'm finding that most of what you'd normally use tables for can be accomplished with divs, the upper-leftmost of them being absolutely positioned, and the others in the "table area" being relatively positioned to that one. (Just redesigned my essay/blog/rant site with divs & CSS instead of <table>s and <font>s... It seems to function well in NN, IE and Opera, but it DOES use align="center" in some of the div tags...)

Relative positioning among divs seems to default to whatever div comes immediately previous in the actual page code, which leaves a lot of interesting room to experiment with page content optimization positioning vs. page content visual positioning. (could easily cause a WHOPPER of a headache if you tried to get too tricky)

<added>(I'm now getting a vague idea about replacing "center" with 100% width divs that have varying amounts of margin or padding... Like instead of an 80% width centered div, could you have a 100% width div with 10% margins?)</added>

brotherhood of LAN

 12:44 am on Apr 9, 2002 (gmt 0)

Mivox one thing ive been doing, that doesnt require centre for the main bulk of a page

5% left cell, 70% "main" body cell, 5% padding cell, 20% space_for_navigation_cell

but in some include files i might want to still centre stuff without using the bloat of extra HTML.

ie the "main body cell" is your centered content


 1:34 am on Apr 9, 2002 (gmt 0)

Mivox, try this CSS "gimme"




 1:53 am on Apr 9, 2002 (gmt 0)

Hola. If the <font> tag is to go away (I understand deprecated to mean it's fallen from favor but not necessarily dropped) what will be its replacement - a style declaration?

Purple Martin

 2:00 am on Apr 9, 2002 (gmt 0)

lorax - yup, the class attribute works great.


 2:44 am on Apr 9, 2002 (gmt 0)

Mivox, try this CSS "gimme"
{ text-align:center; }

:) Got that one, but what I was thinking of specifically was a div with a background image, approx 75% of page width, centered. The text is actually left-aligned within the div.

Got the interior margins set to allow some nice "breathing room" around the text and the outside of the div, it's just keeping the tiled background image limited to that "floating box" look in the middle of the page. Setting the div width percentage w/CSS and just using align="center" in the div tag was so easy...


 2:47 am on Apr 9, 2002 (gmt 0)


Man, I was reading through the post thinking, oh, I found the answer to that one and sure enough, papabaer was right there.

I've been using that text-align attribute quite a bit and it works quite well. No probs that I can see and I'm testing a wide variety of browsers and on PC and Mac platforms. I'm on the Mac now.

P.S. Couldn't you just use <span> tags with text-align attributes?


 2:53 am on Apr 9, 2002 (gmt 0)

>Hola. If the <font> tag is to go away (I understand deprecated to mean it's fallen from favor but not necessarily dropped) what will be its replacement - a style declaration?

Hello lorax, I've been using the <span> tag to define inline elements and then classes for block elements.

If you were specifying that a title somewhere in the middle of a paragraph is to be blue and bold, you would assign a <span> tag to that title and specify attributes in your css.


 3:05 am on Apr 9, 2002 (gmt 0)

Seems as if I have just been deprecated.
Well, all in all this is likely a good thing.
Not sure why, but I am sure someone can tell us.


 3:08 am on Apr 9, 2002 (gmt 0)

It's POWER, pure and simple... albeit a trifle unweildly at times, but the adrenaline rush is definately worth it!



 3:18 am on Apr 9, 2002 (gmt 0)

tedster, hopefully you won't mind this CSS reference for HTML translations to CSS.

CSS Pointers Group [css.nu]

I also found Opera's CSS support page somewhat helpful...

Opera support for CSS [opera.com]

(edited by: pageoneresults at 3:22 am (utc) on April 9, 2002)


 3:22 am on Apr 9, 2002 (gmt 0)

Giving up <font> tags is not so bad... as Pageone notes (hey! how's it goin' eh?), you can gain quite a bit of control using styles.

I have always been a sucker for drop-caps using the span tag and applying a .class to the first letter of an opening paragraph is something I use on occasion. It's simple, it's easy and it is all style (no image involved).

font-weight: bold;
color: #000;
font-size: 26px;
float: left;
background-color : Silver;
padding : 0px 2px;

font-weight: bold;
color: #600;
font-size: 26px;
float: left;
background-color: #fc0;
padding : 0px 2px;

(based on a paragraph font-size:12px ;)


 3:26 am on Apr 9, 2002 (gmt 0)

The attributes that Tedster lists are what I believe may be the most challenging for many to adapt to... many of these have become "second-nature" for us.


 3:30 am on Apr 9, 2002 (gmt 0)


I'll agree with you on that one! At first I was totally baffled by css and then one day it clicked, and I haven't been the same since!

The <font> tag is going to be the most difficult for people to break away from. But, when they find out what you can do with it in css, they won't ever use that <font> tag again!

You can assign font attributes to both block level elements and inline elements. Anything you did with your deprecated html tags can now be done in your css. And much, much more! The same applies to the rest of the list that tedster has posted above.

brotherhood of LAN

 3:57 am on Apr 9, 2002 (gmt 0)

As long as all the code amounts to less being used, im all for it


 4:08 am on Apr 9, 2002 (gmt 0)

Me too! This...

<span class="bi80">Content here</span>

sure beats this...

<font color="#808080 "other attributes><b><i>Content here</i></b></font>

I can see now why the <font> tag is deprecated. Can you imagine how many instances of the <font> tag there are online? Whoa! Can anybody give an accurate estimate?


 5:03 am on Apr 9, 2002 (gmt 0)

CENTERED CONTENT!!!! Ahh... I can breathe easy now...

#content { margin-right: 15%; margin-left: 15%; top: 80px }
<!-- top: 80px because I have a 72px tall header, aligned left -->
#textblock { font-size: 15px; line-height: 20px; font-family: Arial, Helvetica, Geneva; background: white url(http://domain.com/image.gif) repeat scroll; text-align: left; margin: 10px 15px; padding: 10px 15px; width: auto; overflow: visible; visibility: visible }

If you nest <div id="textblock"> INSIDE <div id="content">, #textblock ends up being a nice little "block" of contrasting background, filled with text, CENTERED on the page, in NN 4.7, IE 5.1 & Opera 5/Mac. Scales perfectly to page width on resize.

Dunno about the PC browsers, but I haven't had a really big problem with PC browsers mucking up my CSS. I think if you can get it right in NN, Opera and IE on either platform, your proverbial behind must be pretty well covered...


 5:11 am on Apr 9, 2002 (gmt 0)

Hi, my name is Jason...

...and I'm addicted to HTML tags. I KNOW I should stop, really, but it's soooo hard to do.

...but thanks to a little inspiration from papbaer and tedster, I'm on the track to deprecated tag freedom!! Thanks guys!! -- I probably would have never had the willpower to move towards w3c validation if it wasn't for your inspiration.

...by the way, anybody want to go out for a <font> tag? or a bgcolor=?

...O.K., so I have a little ways to go...

</html> I trying to.....


 5:15 am on Apr 9, 2002 (gmt 0)

But wait, you left out...



The conversion is fairly quick once you get the hang of it. Just think, you'll be stripping away 30-50% of your html bloat. That means an increase in text to html ratio which has been discussed recently.

Hey mivox, congratulations. I got dizzy reading through that CSS!


 5:20 am on Apr 9, 2002 (gmt 0)

PageOneResults, how long did it take you to see the light in the first place. Then, jow long did it take for you to become totally compliant?


 5:23 am on Apr 9, 2002 (gmt 0)

It's a big temptation to just splash <span> tags all over the place, but you never really get everything that CSS can do for you that way - and in the end you really want what CSS can do, even though there's both a learning curve and (presently at least) a browser support challenge.

Not that <span> is a taboo - it's totally valid. But you're better off thinking of it as a last resort.

> tedster, hopefully you won't mind this CSS reference for HTML translations to CSS.

pageoneresults, no problem with links to an authoritative resource - unless, of course we've already got the info right here. Those are two very helpful resources, thanks.


 5:28 am on Apr 9, 2002 (gmt 0)

Hello JustTrying. I actually started a couple of years ago with just the basics. In the last 4 months I've gone from CSS1 to CSS2 and now reading up on CSS3. I have four sites now that I've either developed or have rebuilt from scratch that are now using CSS and Absolute Positioning.

Thanks to the information that I've gained here at the forums and my own testing, I'm now a CSSaholic. Oh, I'm nowhere near the level of papabaer (you should sticky him for some URL's!), but I am producing well structured sites and highly optimized html. All four sites have validated for HTML 4.01 Transitional and CSS2. I literally validated just over 100 pages with the W3C a few days ago. Cut and paste, cut and paste, cut and paste, revalidate, revalidate, revalidate...

Once you get the first core template of the site validated, the rest of the pages are a breeze!


 5:32 am on Apr 9, 2002 (gmt 0)

> and my own testing

There's a strange kind of geeky pleasure I get out of testing various CSS setups. I only wish I had more time to hack away - it is kind of addictive, and practical at the same time.

It reminds me of a lost day a few years ago when I did nothing but play with tables until I had them nailed.

But css takes a bit more than one day, doesn't it :)


 5:33 am on Apr 9, 2002 (gmt 0)

tedster, can you give me an example of how the <span> element would be replaced in this instance?

I have a paragraph that starts off with a bold headline, a <br> after the bold headline, and then normal paragraph copy. It looks like this...

<p><span class="bi80>Paragraph Header</span><br>
Paragraph content</p>

How would you go about controlling the appearance of just that paragraph header and not have it affect the rest of the <p> tag or block element? I haven't quite gotten that far in my CSS journey and would definitely like to learn now before I start <spanning> all over the place!


 6:14 am on Apr 9, 2002 (gmt 0)

pageone... take a look at this: [w3.org...]


 6:35 am on Apr 9, 2002 (gmt 0)

Aw man, every time you or tedster reply to one of these topics I end up losing sleep! ;)

This 49 message thread spans 2 pages: 49 ( [1] 2 > >
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