Reply to Re: class vs. style

Your name:

Reply:


Posted by Ben C on 01/19/07 10:42

On 2007-01-19, Robin Rattay <rotora@gmx.net> wrote:
> Hi,
>
> Jukka K. Korpela wrote:
>> Scripsit Ben C:
>>
>>>> .no_left_border {border-left: 0px solid}
>>>> table td {border-left: 1px solid}
>>>>
>>>> <td class="no_left_border"> <-- doesn't work -->
>>>> <td style="border-left: 0px solid"> <-- works -->
>>>
>>> table td is more "specific" than .no_left_border, so wins. But the
>>> style attribute is more specific still.
>>
>> Right. So a practical conclusion is that you can affect this by using a more
>> specific selector in the first rule, e.g.
>>
>> table td.no_left_border {border-left: 0px solid}
>
> I need to delurk for a moment, since I'm confused.
>
> I've re-read the CSS specification on specificity, and tested it in FF,
> resulting in the conclusion, that ".no_left_border" is more specific
> than "table td" (0010 verses 0002). So both examples of the OP should be
> showing no border, i.e. "working".

You're right, I just read that section again (6.4.3), and everything you
say is correct. I spoke too soon. I also tried it in Opera and Konqueror
and it worked as expected.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация