Reply to Re: class vs. style

Your name:

Reply:


Posted by Robin Rattay on 01/19/07 09:47

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".

Robin

[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

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