Previous Message
Next Message

selector for missing attribute?

Sent by Joe Schmitt on 22 July 2007 09:09


Good point.
I've stopped using HTML attributes where ever possible, so it didn't occur
to me.
I would've used something like:

<style type="text/css">
caption, th, td {
 text-align: left;
}
..center {
 text-align: center;
}
..right {
 text-align: right;
}
</style>

<table border="1" width="400">
   <caption>This is a table</caption>
   <tr>
    <th class="center">heading</th>
    <th>heading</th>
   </tr>
   <tr>
    <td class="center">data</td>
    <td>data</td>
   </tr>
   <tr>
    <td>data</td>
    <td class="right">data</td>
   </tr>
</table>

Joe
----- Original Message ----- 
From: "Jukka K. Korpela" [EMAIL-REMOVED]>
To: [EMAIL-REMOVED]>
Sent: Sunday, July 22, 2007 3:52 AM
Subject: Re: [css-d] selector for missing attribute?


> On Sun, 22 Jul 2007, Joe Schmitt wrote:
>
> > caption, th, td {
> > text-align: left;
> > }
> >
> > Now all browsers (including IE) will left align the "th" elements as the
> > default.
>
> They will, but this works all too well: align attributes in HTML markup
> will not override it. By the CSS cascade rules - and browsers follow them
> in this respect - presentational HTML attributes will be mapped
> (internally by a browser) to CSS rules that have the lowest possible
> specificity.
>
> -- 
> Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
>
> ______________________________________________________________________
> css-discuss [EMAIL-REMOVED]]
> http://www.css-discuss.org/mailman/listinfo/css-d
> IE7 information -- http://css-discuss.incutio.com/?page=IE7
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: