Reply to Re: class vs. style

Your name:

Reply:


Posted by Jukka K. Korpela on 01/18/07 23:23

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 -->
>>
>> Can someone explain the behind the scenes reasons?
>
> 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}

(You could alternatively use !important, but it's easy to create confusion
that way. Reserve !important for special occasions.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

[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

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