Hi, regarding my previous message, are transitional doctypes quirks mode - lo and behold! I finally got it collect, I would like to get enlightenment from you knowledgeable ones about quirks mode and font size inheritance.

The quest came from a discussion from a CSS study group. Someone posted a question why the font size in particular section (link list) in her page appears much smaller than 12px.

In her CSS, she declared:

body {font-size: 12px}
a {font-size: 12px}

I answered it was because font-size is inherited and that "a" element inherited the 12 pixel font size from body, and suggested

body {font-size: 100.1% }

be used, I also suggested to change the pixel unit to em.

Someone else replied that the font size in link list appear smaller was because the page has no doctype, hence through browsers throw the page to quirks mode.

I disagreed - declaring doctype is important however on this particular case, it's the inheritance of font-size that causes the problem. Along the way, I said transitional doctype also throw the page to quirks mode - and I truly believed what I said when I said it.

I came up with examples to prove my point.
http://lotusseedsdesign.com/sapotek/group-px.gif
and their respective pages:
http://lotusseedsdesign.com/sapotek/xhtml-strict-dtd-px.html
http://lotusseedsdesign.com/sapotek/xhtml-tran-dtd-px.html
http://lotusseedsdesign.com/sapotek/html-strict-dtd-px.html
http://lotusseedsdesign.com/sapotek/html-trans-dtd-px.html
http://lotusseedsdesign.com/sapotek/nodtd-px.html

In the original page, font-size only declared in a and body elements.
In my five examples, the nodtd-px page, the headings and p tag content, the font size appears bigger than those that have doctype declared.

Hence I wrote:
As you can see clearly, the a tag linklist makes no different whether
it has doctype declared or not, and it makes no different with strict
or transitional (quirks mode) doctype or not, be it html or xhtml.

With pages that have doctype declared, the font size was not declared
in all headings and p, therefore they inherited from the body 12px
font-size. The one with no doctype declared, the headings and p font
size appears bigger, this I believe is that browser default takes
precedence when it doesn't need to listen to doctype (or rather, no
doctype tells her what to do). Why it does so? I have no knowledge to
explain it, but my assumption is such:
It takes 'two' in order for inheritance to work, and with criteria -
that is why you see the link list' font size appear the same in
different doctype because it's being declared to 12px in css, and it
inherited from the 12px font size from the body that is also declared
in css.

So, it seems the way it works is such:

When there are two elements declared font size in CSS and the two
elements have inheritance relationship, even without doctype, browser
smartly followed - and this maybe the criteria (or condition) browser
has.

So when criteria is not meet, without doctype, browser doesn't follow
and doesn' take the parent font size into account.

However, it seems that when there is doctype declared, criteria
partially meets, it takes parent font size as higher specificity , and
make the headings and p inherit to their parent font size, which is
the body.



Now I get confused, have little faith to what I thought was correct, and here I am, seeking for the correct answer from you who have more knowledge and experience in this area.

p/s. I know my English is difficult to understand. Please read it once, read it twice, read it thrice and read it few more time until you understand what I am trying to say :)

tee




******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to