Strange browser differences in handling of COL styles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harlan Messinger

    Strange browser differences in handling of COL styles

    I've put a sample web page at



    that illustrates strange inconsistencies both among and within browsers in a
    situation where I've applied styles to various parts of a table, including
    COL elements (though that may or may not be the cause of the problem. Both
    HTML and CSS pass validation.

    I assigned the class "project-data-attribute" to the first of two columns in
    tables (having class "project-data") like the following:

    Grantee: Aardvark College
    Project Director: Dr. Aaron Aramanian
    Project Title: Fifty Ways to Leave Your Lover


    I want to specify the width of the first column and have it bolded. The
    following rule is theoretically applicable.

    table.project-data .project-data-attribute {
    width: 10em;
    font-weight: bold; }

    I tested this in IE6, Netscape 7, Firefox 1.0, and Opera 7.54. The width is
    set correctly in ALL of these browsers BUT only IE boldfaces the text!

    Exploring further, I added two more properties to this rule:

    table.project-data .project-data-attribute {
    width: 10em;
    background-color: #ee9;
    color: #42c;
    font-weight: bold; }

    As with boldfacing, the text color is only applied by IE6. The text remains
    black in the other browsers. Even more oddly, the background color *does*
    show up in Firefox and Opera as well as in IE--but it doesn't show up in
    Netscape.

    Testing whether it was a somehow a specificity problem, I changed
    ..project-data-attribute to col.project-data-attribute, but that didn't make
    any difference. I even tried making it less specific, removing the
    table.project-data container selector, but no change in result.

    Comments? Alternative approaches, short of applying the class to each of the
    first-child TDs individually? Thanks.

    --
    Harlan Messinger
    Remove the first dot from my e-mail address.
    Veuillez ôter le premier point de mon adresse de courriel.

  • Neal

    #2
    Re: Strange browser differences in handling of COL styles

    On Thu, 18 Nov 2004 14:02:12 -0500, Harlan Messinger
    <h.messinger@co mcast.net> wrote:
    [color=blue]
    > Comments? Alternative approaches, short of applying the class to each of
    > the
    > first-child TDs individually? Thanks.[/color]


    You can only use the background, border, visibility and width properties
    on col and colgroup.

    Comment

    • Neal

      #3
      Re: Strange browser differences in handling of COL styles

      On Thu, 18 Nov 2004 14:28:56 -0500, Neal <neal413@yahoo. com> wrote:
      [color=blue]
      > On Thu, 18 Nov 2004 14:02:12 -0500, Harlan Messinger
      > <h.messinger@co mcast.net> wrote:
      >[color=green]
      >> Comments? Alternative approaches, short of applying the class to each
      >> of the
      >> first-child TDs individually? Thanks.[/color]
      >
      >
      > You can only use the background, border, visibility and width properties
      > on col and colgroup.
      >[/color]

      Forgot to add: [http://ln.hixie.ch/?start=1070385285&count=1]

      Comment

      • Harlan Messinger

        #4
        Re: Strange browser differences in handling of COL styles


        "Neal" <neal413@yahoo. com> wrote in message
        news:opshodsolo 6v6656@news.ind ividual.net...[color=blue]
        > On Thu, 18 Nov 2004 14:28:56 -0500, Neal <neal413@yahoo. com> wrote:
        >[color=green]
        > > On Thu, 18 Nov 2004 14:02:12 -0500, Harlan Messinger
        > > <h.messinger@co mcast.net> wrote:
        > >[color=darkred]
        > >> Comments? Alternative approaches, short of applying the class to each
        > >> of the
        > >> first-child TDs individually? Thanks.[/color]
        > >
        > >
        > > You can only use the background, border, visibility and width properties
        > > on col and colgroup.
        > >[/color]
        >
        > Forgot to add: [http://ln.hixie.ch/?start=1070385285&count=1][/color]

        OK, thank you very much. But--bah! At least my grief is shared.

        Comment

        Working...