HighDots Forums  

Re: font properties not honored in style

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: font properties not honored in style in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Evertjan.
 
Posts: n/a

Default Re: font properties not honored in style - 07-18-2003 , 04:58 PM






Doug Poland wrote on 18 jul 2003 in
comp.infosystems.www.authoring.stylesheets:

Quote:
style type="text/css"
.cssTableHeading {
font-family: Verdana, Arial, Sans-Serif, Helvetica;
font-size: 9pt;
font-weight: bold;
text-align: center;
color: #FFFFFF;
background-color: #00595A
}
/style

In the HTML:

table
tr class="cssTableHeading"
td> Bold white letters on ugly green background </td
/tr
/table
/body
/html

When rendered, I see the TR background color and text-align but none
of the font
attributes are honored. How can the second style to completely
override the first?

TR has no text contents, so font and color and textalign do nothing.

You will heve to reach them by:

<style type="text/css">
.cssTableHeading TD {
.............

see an example in:

<http://groups.google.com/
groups?selm=Xns93BA1C22B748eejj99%40194.109.133.29 >


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: font properties not honored in style - 07-19-2003 , 02:31 AM






"Evertjan." <exjxw.hannivoort (AT) interxnl (DOT) net> wrote:

Quote:
TR has no text contents, so font and color and textalign do nothing.
All elements still have all properties. And the "children"
(subelements) of TR inherit properties from their "parent" _if_ the
usual inheritance conditions are fulfilled, i.e. if the property is
inherited and if there is no other setting for this property for it
(except the initial value declated in the property's definition in CSS
specification). And font, color, and text-align properties are
inherited.

On the other hand, in this case, as far as we can deduce from the
problem description, the "children" have those properties set, so
inheritance does not affect them. It affects background-color, since
the first style sheet (incorrectly*)) does not set background-color.
*) Incorrectly in the sense that you should always set color and
background together, to avoid nasty effects of style sheet
interaction, although this is not a requirement in the CSS
specifications.

But honestly, the style sheets in the original question strongly
suggest that the OP should consult good primers and FAQs on CSS before
trying to understand the finer points like the cascade. The FAQs of
this group are a good starting point; in particular they explain why
setting a global fixed font size in an author style sheet is a poor
idea. Actually I would say that font-size: xx-small for BODY is
undescribably foolish.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.