|
Grace's Guide to Cascading Style Sheets Replacing Deprecated CodeCSS and Deprecated Elements"Deprecated" is a cool word. I'm not sure why I like hearing it, but every time mom says it, I think its cool. Okay, so I'm a silly cat, but I do know what deprecated means. It means outdated and replaced. For example, in HTML 4.01 the font element is outdated. Instead of using the font element, you should use CSS properties such as font-family, font-size, font-weight. For example, I want to add a sentence with the following properties: comic sans ms font, larger than the regular font size, bolded, pink, and italics like the following: Bold, bright pink italicized text in Comic Sans MS
The deprecated code would look like this: <center><p><font face="Comic Sans MS" color="#FF1493" size="+2"><i><b>Bold, bright pink italicized text in Comic Sans MS</b></i></font></p></center> Transforming the deprecated code to CSS gives us the following: <style type="text/css"> Much clearer, huh? It's lots easier to use again and again when it is defined as a class. Deprecated elements include: basefont, center, font, s (strikethrough text style), strike (strikethrough text), and u (underline). A full list of all HTML 4.01 elements and their status is located on the W3C site at http://www.w3.org/TR/html4/index/elements.html CSS and Deprecated AttributesHTML attributes can be deprecated too. CSS is great because it can easily replace this outdated stuff. Here are some of the deprecated attribtues: align (for just about every element except some of the table elements), alink, background and bgcolor, border in the img element, face in font and basefont, language in the script tag, link in the body tag, noshade, nowrap, size in hr and font, text in the body element, type in list elements, and vlink. A complete list of HTML 4.01 attributes can be found on the W3C site at http://www.w3.org/TR/html4/index/attributes.html |