SitePoint Sponsor

User Tag List

Results 1 to 21 of 21
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    at home
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can't change font using Font tag

    Hi,

    I am helping a person work on a web page, and usually use CSS to make font changes. Unfortunately, the person has to get this out quickly and does not have time to learn CSS. They have FrontPage 2003 and are editing with it in design / visual mode. htey are trying to use the font face and size dropdowns to change text appearance.

    I notice that I can change the text appearance by choosing the Style dropdown. But the Font face and Font size dropdowns do nothing. What can override using those two (older) methods for changing the font and size?

    The top of the document reads this way in the tags ...

    <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="urn:schemas-microsoft-comfficeffice" xmlns="http://www.w3.org/TR/REC-html40">

    Do these schemas block using the font tag?

    Any insights are appreciated. When we have time, we'll switch this to CSs, but for now, what is preventing us from using the font face and size tags?

  2. #2
    SitePoint Enthusiast v1rgil's Avatar
    Join Date
    Dec 2008
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got this from w3schools.com.

    Code HTML4Strict:
    <p>
    <font size="2" face="Verdana">
    This is a paragraph.
    </font>
    </p>

    The <font> tag in HTML is deprecated. It is supposed to be removed in a future version of HTML.
    not sure if the tag still works on modern browsers.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    at home
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Thanks for the quick reply,

    We use IE 6 still as a company standard. We know how to write the tags, it is just that something in the browser is blocking them. Do namespaces do that, like the ones I noted in the original post?

    TIA

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have a CSS with rules that affect the same elements, the CSS will override the font tags.
    Birnam wood is come to Dunsinane

  5. #5
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Why don't you just get them to use style="font: Verdana; font-size: 20px;" directly within the tag they want to apply rather than using <font> and using a depreciated system? It does not require any more code (just a reshaping of the existing stuff).

    PS: The problem with your friend pushing this out as quickly as possible without doing the job right will mean if the website needs to be updated, it will take a lot more work to fish around the code and update it rather than to have just done it correctly the first time.

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    Why don't you just get them to use style="font: Verdana; font-size: 20px;" directly within the tag
    That would be invalid, since the font shorthand property requires at least a font size and a font family. It should be, style="font:20px Verdana". Even shorter!
    Birnam wood is come to Dunsinane

  7. #7
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Yes, my bad. I don't tend to use that method as I usually declare each separately (font-family, font-size, font-weight, font-style, etc). I get so forgetful with code

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    at home
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good points. On my original question, can a namespace directive or some mechanism, running in IE6, lock out the font tag in favor of CSS?

  9. #9
    SitePoint Zealot
    Join Date
    Mar 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, they haven't got time to learn a few lines of basic CSS, but there's enough time to try to hack a solution to using a depreciated bit of HTML that won't necessarily work right in different browsers? I'm with AlexDawson on this one; take half an hour to learn basic CSS and save hours of grief in the future.
    Learn all about diamonds,
    Check out some period-drama movies and TV series,
    Or get festive with The Wonder of Christmas.

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    There are even some browsers that no longer recognise the font tag so CSS is the only way that will work properly.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    SitePoint Wizard Blake Tallos's Avatar
    Join Date
    Jun 2008
    Location
    Cuyahoga Falls, Ohio.
    Posts
    1,511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    There are even some browsers that no longer recognise the font tag so CSS is the only way that will work properly.
    WOW, really? I did not know that. Which ones?
    Blake Tallos - Software Engineer for Sanctuary
    Software Studio, Inc. C# - Fanatic!
    http://www.sancsoft.com/


  12. #12
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    There are even some browsers that no longer recognise the font tag so CSS is the only way that will work properly.
    Is there any important ones? firefox, explorer and so on because I am going to have to rewrite my whole dang site.

  13. #13
    SitePoint Wizard Blake Tallos's Avatar
    Join Date
    Jun 2008
    Location
    Cuyahoga Falls, Ohio.
    Posts
    1,511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code CSS:
    * {
        padding: 0px;
        margin: 0px;
     
    }
     
    p {    
     
        font-family:verdana;
        font-size:2em;
     
    }

    Code HTML4Strict:
    <p>Simple as that</p>
    Blake Tallos - Software Engineer for Sanctuary
    Software Studio, Inc. C# - Fanatic!
    http://www.sancsoft.com/


  14. #14
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by felgall View Post
    There are even some browsers that no longer recognise the font tag so CSS is the only way that will work properly.
    felgall, I would like to know which ones as well, it would be really useful to put in my endless rants about web standards, lol

  15. #15
    SitePoint Enthusiast v1rgil's Avatar
    Join Date
    Dec 2008
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    There are even some browsers that no longer recognise the font tag so CSS is the only way that will work properly.
    i got this from
    http://www.w3schools.com/tags/tag_FONT.asp

    it says font tag is supported in all major browsers but not when page is strict xhtml 1.0.

    The font element was deprecated in HTML 4.01, and is not supported in XHTML 1.0 Strict DTD.

  16. #16
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by v1rgil View Post
    i got this from
    http://www.w3schools.com/tags/tag_FONT.asp

    it says font tag is supported in all major browsers but not when page is strict xhtml 1.0.
    That page - no, the entire site - is ancient (okay, so ancient it makes ancient look new), has nothing to do with the W3C and frankly was not a good source to learn from anyway (at least in my own considerably extensive personal experience).

  17. #17
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    That page - no, the entire site - is ancient (okay, so ancient it makes ancient look new), has nothing to do with the W3C and frankly was not a good source to learn from anyway (at least in my own considerably extensive personal experience).
    I agree - the two guys who created that site appear to have made very few updates (if any) in recent years. The only reason that they get as many visitors as they still do is because they got llucky with a domain name that misleads people into thinking that their site is something that it is not.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #18
    SitePoint Enthusiast v1rgil's Avatar
    Join Date
    Dec 2008
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey guys,

    i got this from http://www.w3.org/MarkUp/

    FONT tag considered harmful! Many filters from word-processing packages, and also some HTML authoring tools, generate HTML code which is completely contrary to the design goals of the language. What they do is to look at a document almost purely from the point of view of layout, and then mimic that layout in HTML by doing tricks with FONT, BR and &nbsp; (non-breaking spaces). HTML documents are supposed to be structured around items such as paragraphs, headings and lists. Yet some of these documents barely have a paragraph tag in sight!
    The problem comes when the content of pages needs to be updated, or given a new layout, or re-cast in XML (which is now to be the new mark-up language). With proper use of HTML, such operations are not difficult, but with a muddle of non-structural tags it's quite a different matter; maintenance tasks become impractical. To correct pages suffering from injudicious use of FONT, try the HTML Tidy program, which will do its best to put things right and generate better and more manageable HTML.
    it is really helpful and very much appreciated if you guys can point us into an up-to-date authoritative web site that says some browsers ceased to support <FONT> tag.

    just need to know which browsers that's all.
    i'm no good at throwing criticisms.
    just wanted to learn and share ideas in this forum.

    thank you.

  19. #19
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    No current browser supports the font tag if you are using CSS since the CSS overrides the font tags. The last popular browser where this didn't occur was Netscape 3 which didn't support CSS. Only by not using CSS can you get any modern browsers to recognise font tags and since it is over a decade since browsers last expected to use font tags there is no guarantee that they will function as expected in modern browsers since the browsers don't expect them to be used any more. I am not sure what browsers completely ignore the tag even if there is no CSS but I do remember that about six or seven years ago I was running some tests using font tags and there was at least one browser back then which ignored the tag completely. I haven't run any recent tests with the font tag for the same reason I don't check for dinosaurs in my front yard before I go out.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  20. #20
    SitePoint Enthusiast v1rgil's Avatar
    Join Date
    Dec 2008
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well in any case, one should avoid this deprecated tag instead use <span> and style it using font-* properties. worth your time rather than figuring out how to make obsolete tag work.

  21. #21
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    That page - no, the entire site - is ancient (okay, so ancient it makes ancient look new), has nothing to do with the W3C and frankly was not a good source to learn from anyway (at least in my own considerably extensive personal experience).
    It is a shame really, the website is where many of us first learned to code, for such a well established resource they should put the time in to bring all the information up-to-date. Perhaps they could turn the language guides into a Wiki which professional developers could establish best practices and such to keep the content fresh and on edge.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •