Robai Posted October 19, 2010 Share Posted October 19, 2010 Please explain why this does not validate.This is my test.htm file: <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Some title</title></head><body><p><font>some text</font></p></body></html> Trying to validate it herehttp://validator.w3.org/Validation result is this: Line 13, Column 9: element "font" undefined <p><font>some text</font></p> Link to comment Share on other sites More sharing options...
justinbriggs1 Posted October 19, 2010 Share Posted October 19, 2010 <font> is deprecated. Better to use a <span>, <div>, or other element, assign it a class or ID, and use CSS to define the font.Here is one way: <style>p {font-family:Helvetica;}</style><p>some text</p> Link to comment Share on other sites More sharing options...
gabrielebr Posted October 19, 2010 Share Posted October 19, 2010 Please explain why this does not validate.This is my test.htm file:<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Some title</title></head><body><p><font>some text</font></p></body></html> Trying to validate it herehttp://validator.w3.org/Validation result is this: Line 13, Column 9: element "font" undefined <p><font>some text</font></p> also <p style="font-size: 1em">text</p> instead of font-size you can set the attribute you need. The attibutes "translated" into css can be found here, for example: http://www.w3schools.com/css/css_font.aspciaoGabriele Link to comment Share on other sites More sharing options...
Robai Posted October 19, 2010 Author Share Posted October 19, 2010 Thank you!I've looked herehttp://www.w3schools.com/tags/tag_font.aspand found there that attributes of <font> tag are deprecated, but I didn't noticed that the tag <font> itself is deprecated too.LOL Link to comment Share on other sites More sharing options...
Robai Posted October 19, 2010 Author Share Posted October 19, 2010 Just curious why Dreamweaver 8 added <font> tag when I selected text "some text" here <p>some text</p> and then I clicked on Font Tag Editor button (it is on Text palette) and picked color red, which gave this result: <p><font color="#FF0000">some text</font></p> Why on the heavens it added <font> tag when it is deprecated (and doctype is strict)? Link to comment Share on other sites More sharing options...
thescientist Posted October 19, 2010 Share Posted October 19, 2010 Whose to say that dreamweaver conforms to the standards? From what I've gathered and many here will point out, dreamweaver should not necessarily be relied on for producing semantic, valid markup. It's best to be used as an editor with some handy features, rather than a drag and drop editor. You're better of learning the syntax anyway and the standards yourself, anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.