Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

when i use <font color="#525C65"> tag i am getting Error, Attribute 'font' is outdated tag.

pls.help.
Posted
Updated 5-May-11 22:53pm
v2
Comments
Graham Breach 6-May-11 4:55am    
You haven't said where you are using it, or what is giving you the error. But it is true that the font tag is outdated, and you should use CSS to modify text colours.

HTML 4 Depricated this tag, you should get rid of it. The World Wide Web Consortium (W3C, the people responsible for the HTML standard) admit that they got HTML3 badly wrong when it comes to styling.
Refs:
http://www.w3schools.com/html/html_styles.asp[^]
and
http://www.w3schools.com/css/css_intro.asp[^]

HTML was orignally about document content not document format the W3C started to mix these up in HTML, the result was things like the <font> tag, and it made things ugly. The W3C are in the process of removing these tags in the standard thankfully. New browsers following the standard do not need to support this tag. My advice is to get rid of the <font> tags and replace with stylesheets if at all practical.
 
Share this answer
 
Comments
Ed Nutting 6-May-11 15:30pm    
Good answer, my 5+ :)
Read here (an excellent source BTW) http://www.w3schools.com/tags/tag_FONT.asp[^] and they will tell you that the font tag is deprecated. They continue with saying to use CSS[^] instead to do the styling.

Best Regards,

-MRB
 
Share this answer
 
v2
Comments
Ed Nutting 6-May-11 15:31pm    
Good answer, my 5 :)
Never use font tag! This is a very bad style and this is extremely hard to maintain. Always use CSS.

—SA
 
Share this answer
 
Comments
Ed Nutting 6-May-11 15:32pm    
To be far this is a little thin on help. A link to W3C would probably be useful ;P
Sergey Alexandrovich Kryukov 6-May-11 19:54pm    
You're right. My help here is just shouting. This is a thin hint... :-)
--SA
no need to give the font tag instead of that u can use the style propety

Happy Codding..:)

Seshu
 
Share this answer
 
Specially for the probably mentally retarded person who vote "1" for my answer (I have no idea who is this anonymous, so I hope I don't offend anyone):

Never use font tag! This is a very bad style and this is extremely hard to maintain. Always use CSS. Hope that after repetition it becomes more understandable.

—SA
P.S.:
gani7787, I'm really sorry for this noise; I was just irritated. If I say "don't use" I really mean it and motivate it; hope it will help you.
 
Share this answer
 
v2
Comments
Ed Nutting 6-May-11 15:33pm    
My 4, not quite as thorough as the other answers but definitely doesn't deserve a 1. Upvoted your other solution to help ;)
Sergey Alexandrovich Kryukov 6-May-11 16:12pm    
Thank you very much. I posted just out of my stubbornness... What the hell?..
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900