CSS stylesheet with * attribute

Discussion in 'HTML' started by qbert@gmx.at, Aug 15, 2007.

  1. Guest

    I am using this stylesheet :

    * {font-family:verdana;font-size:15px}
    #ta{font-size:30px;color:red}

    With the #ta class i want to make my table's text look red and big.
    <table id="ta">...

    Bad thing: only the red color shows up, font-size stays as defined in
    *
    What am i doing wrong?
    Thanks,
    Karl
     
    , Aug 15, 2007
    #1
    1. Advertising

  2. Dylan Parry Guest

    wrote:
    > I am using this stylesheet :
    >
    > * {font-family:verdana;font-size:15px}
    > #ta{font-size:30px;color:red}
    >
    > With the #ta class i want to make my table's text look red and big.
    > <table id="ta">...


    IIRC, some browsers (specifically IE) have problems with styles defined
    for tables. You may find that changing "#ta" to "#ta td, #ta th" helps
    as that specifically applies styles to the cells (and header cells)
    within the table, not just the table itself.

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    The opinions stated above are not necessarily representative of
    those of my cats. All opinions expressed are entirely your own.
     
    Dylan Parry, Aug 15, 2007
    #2
    1. Advertising

  3. Guest

    > for tables. You may find that changing "#ta" to "#ta td, #ta th" helps
    > as that specifically applies styles to the cells (and header cells)


    Thanks!
    This works.
     
    , Aug 15, 2007
    #3
  4. On 2007-08-15, wrote:
    > I am using this stylesheet :
    >
    > * {font-family:verdana;font-size:15px}
    > #ta{font-size:30px;color:red}
    >
    > With the #ta class i want to make my table's text look red and big.
    ><table id="ta">...
    >
    > Bad thing: only the red color shows up, font-size stays as defined in
    > *
    > What am i doing wrong?


    You have set every element to 15px (which is the wrong way to do
    it; use relative sizing), unless it is specifically changed.
    Elements will not inherit font-size from the containing element.

    Since you cannot use text directly in a <table> element, the 30px
    will not affect anything. You need to apply the styling to the
    cells that contain text, <td> and <th>.

    --
    Chris F.A. Johnson <http://cfaj.freeshell.org>
    ===================================================================
    Author:
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
     
    Chris F.A. Johnson, Aug 15, 2007
    #4
  5. Scripsit :

    > I am using this stylesheet :
    >
    > * {font-family:verdana;font-size:15px}
    > #ta{font-size:30px;color:red}


    Sorry, but it's all wrong. Read a good tutorial on CSS _now_.

    (All settings are wrong: using Verdana, setting font-size in pixels, and
    setting color without setting background - and pure red is seldom a feasible
    color for text.)

    > With the #ta class i want to make my table's text look red and big.


    Stop wanting that.

    > <table id="ta">...
    >
    > Bad thing: only the red color shows up, font-size stays as defined in
    > *


    The "*" selector (not an attribute) selects all elements. So you are setting
    font-size to 15px for all elements, including td elements (table cells). The
    rule with #ta overrides this _only_ for the specific element (the table
    element) that has id="ta". Setting font-size for a table does not directly
    affect anything. It might affect elements inside the table via inheritance,
    but here no inheritance of font-size takes place, since you have set
    font-size for all elements.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Aug 15, 2007
    #5
  6. dorayme Guest

    In article <nTKwi.207876$>,
    "Jukka K. Korpela" <> wrote:

    > ... pure red is seldom a feasible
    > color for text.)


    A web page on the "Galileo of Graphics" breaks out the red paint:

    http://www.edwardtufte.com/tufte/

    --
    dorayme
     
    dorayme, Aug 16, 2007
    #6
  7. mbstevens Guest

    dorayme wrote:
    > In article <nTKwi.207876$>,
    > "Jukka K. Korpela" <> wrote:
    >
    >> ... pure red is seldom a feasible
    >> color for text.)

    >
    > A web page on the "Galileo of Graphics" breaks out the red paint:
    >
    > http://www.edwardtufte.com/tufte/
    >


    What a huge disappointment (but thanks for posting it).
    His books actually have a lot of useful information.

    But on that web page the 'Forum Topics' are hard to read
    and should be bulleted, or at least separated by a
    little space from each other, and the validator is having
    a major Red Bull rage over the thing. I can only hope it's
    more of a publisher thing over which that he didn't have sufficient
    control.

    As to the red links, I don't really have a huge objection, but
    middle red is not the way to go. The red should be toned down
    toward black a bit.
     
    mbstevens, Aug 16, 2007
    #7
  8. dorayme Guest

    In article <>,
    mbstevens <> wrote:

    > dorayme wrote:
    > > In article <nTKwi.207876$>,
    > > "Jukka K. Korpela" <> wrote:
    > >
    > >> ... pure red is seldom a feasible
    > >> color for text.)

    > >
    > > A web page on the "Galileo of Graphics" breaks out the red paint:
    > >
    > > http://www.edwardtufte.com/tufte/
    > >

    >
    > What a huge disappointment (but thanks for posting it).
    > His books actually have a lot of useful information.
    >
    > But on that web page the 'Forum Topics' are hard to read
    > and should be bulleted, or at least separated by a
    > little space from each other, and the validator is having
    > a major Red Bull rage over the thing. I can only hope it's
    > more of a publisher thing over which that he didn't have sufficient
    > control.
    >
    > As to the red links, I don't really have a huge objection, but
    > middle red is not the way to go. The red should be toned down
    > toward black a bit.


    I have no disagreement with any of this. I particularly agree
    about the darker red being more appropriate for text if reddish
    it is to be.

    --
    dorayme
     
    dorayme, Aug 16, 2007
    #8
  9. mbstevens Guest

    dorayme wrote:

    >> As to the red links, I don't really have a huge objection, but
    >> middle red is not the way to go. The red should be toned down
    >> toward black a bit.

    >
    > I have no disagreement with any of this. I particularly agree
    > about the darker red being more appropriate for text if reddish
    > it is to be.
    >

    ....at least if it's going to float on a white background, for contrast.
     
    mbstevens, Aug 16, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    3
    Views:
    5,013
    S. Justin Gengo
    Nov 25, 2003
  2. =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=

    Stylesheet referanse i stylesheet

    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=, Jul 3, 2004, in forum: XML
    Replies:
    3
    Views:
    586
    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=
    Jul 4, 2004
  3. Steven An
    Replies:
    1
    Views:
    508
    Martin Honnen
    Nov 23, 2004
  4. David Blickstein
    Replies:
    3
    Views:
    1,046
    David Blickstein
    Aug 2, 2005
  5. David Blickstein
    Replies:
    14
    Views:
    6,362
    Harrie
    Oct 16, 2005
Loading...

Share This Page