SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Don't eat yellow snow spaceman's Avatar
    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    1,039
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    should the font-family of the body tag apply to all content within?

    Let's say I define the font-family for my body tag to be arial. Assuming I don't define any other tag to be any other font-family, does this mean that all my page content contained within the opening and closing body tags will also be arial - even if that content is contained within other tags such as div, table, td, p, etc?

    My hunch is that, for fully CSS compliant browsers, this should be true. But in reality not all browsers will be so well behaved.

    Or perhaps I'm completely wrong? Perhaps official CSS standards do not say that this should be true?

    Comments anyone?

    Thanks.
    Web Design Perth Melbourne .:. Itomic Business Website Solutions
    Drupal Experts .:. Drupalise

  2. #2
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AFAIK it's true for modern browsers, but NN4 (oh there's a surprise) needs font-family specifying on basically every child of body. Tedious, but necessary.
    Last edited by Zopester; Mar 7, 2003 at 02:58.
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  3. #3
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the rules of CSS inheritance, yeah, it should work fine except where you (or the browser, like in <pre> sections or <textarea>s/<input>s) over ride it. :-)

    ~~Ian

  4. #4
    Don't eat yellow snow spaceman's Avatar
    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    1,039
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ian Glass
    By the rules of CSS inheritance, yeah, it should work fine except where you (or the browser, like in <pre> sections or <textarea>s/<input>s) over ride it. :-)

    ~~Ian
    Thanks for the w3 inheritance link.

    I'm curious: with regard to your point about an <input> tag overriding the font-family setting in the body tag - why wouldn't the standards allow for the <input> tag to inherit the <body> tag font-family setting? I mean, I know what you're saying is true because I've observed it myself, but I'd like to know what the thinking is behind that.
    Web Design Perth Melbourne .:. Itomic Business Website Solutions
    Drupal Experts .:. Drupalise

  5. #5
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i believe the general thinking is that rendering of inputs and textareas is the job of the browser/OS, rather than simply being part of your page. that's why some things still can't be styled (e.g. the "dropdown arrow" thingy on select lists). it's also the thinking behind not making the IE proprietary scrollbar styles a standard...
    getting back to NN4.x, i used to "overload" my stylesheets to ensure a consistent font:

    Code:
    html, body, p, td {
        font-family: whatever;
    }
    but that got me into some weird troubles once i started using em to define font sizes...so now i just ignore NN4.x
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  6. #6
    Don't eat yellow snow spaceman's Avatar
    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    1,039
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by redux
    i believe the general thinking is that rendering of inputs and textareas is the job of the browser/OS, rather than simply being part of your page. that's why some things still can't be styled (e.g. the "dropdown arrow" thingy on select lists). it's also the thinking behind not making the IE proprietary scrollbar styles a standard...
    getting back to NN4.x, i used to "overload" my stylesheets to ensure a consistent font:

    Code:
    html, body, p, td {
        font-family: whatever;
    }
    but that got me into some weird troubles once i started using em to define font sizes...so now i just ignore NN4.x
    Thanks for your thoughts, redux. I'm currently/mostly doing exactly as per your example above, but have also reached the point where I feel comfortable adandoning any lingering respect for NN4.x

    Off-topic: As for using em to define font sizes... aaargh! I'm a px boy myself, but I've seen this debate rage all over the web for a couple of years, so best we don't go there, eh? :-). Unless of course you can point me to a recent article which takes absolutely everything into consideration and comes out strongly in favour of em...

    Thanks again.
    Web Design Perth Melbourne .:. Itomic Business Website Solutions
    Drupal Experts .:. Drupalise


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
  •