473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

CSS classes rendered differently than in-line CSS

http://www.frostjedi.com/terra/scripts/demo/trtd.html
http://www.frostjedi.com/terra/scripts/demo/trtd2.html

Why don't those look the same in Firefox? The latter is the rendering
I'd expect for the first one, as well. The only difference is that
what's defined in-line in the second link is defined via a CSS class
in the first.
Aug 27 '08 #1
1 1418
yawnmoth wrote:
http://www.frostjedi.com/terra/scripts/demo/trtd.html
http://www.frostjedi.com/terra/scripts/demo/trtd2.html

Why don't those look the same in Firefox? The latter is the rendering
I'd expect for the first one, as well. The only difference is that
what's defined in-line in the second link is defined via a CSS class
in the first.
Because a style set directly on an element has higher specificity than
stylesheet rules that match the element (in other words, the
directly-set style takes priority over the ".demo td" selector in the
inline stylesheet), while the ".demo td" selector has greater
specificity than the ".test" selector, the former consisting of a class
selector compounded with an element selector, while the latter consists
of only a class selector. See

http://www.w3.org/TR/CSS21/cascade.html#cascade

for details. From there, you will see that the style attribute has
specificity 1,0,0,0, the ".demo td" selector has specificity 0,0,1,1,
and the ".test" selector has specificity 0,0,1,0.
Aug 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: Axel Dahmen | last post by:
I try to combine properties of several classes. This is done by assigning a space separated list of class definitions to an element. However, IE shows a kind of preference when choosing the right...
7
by: Bora | last post by:
I usually find that a number of unrelated classes require the same kind of operations. However, I don't want to duplicate code in multiple places. In Java, I've seen those "Utility Classes",...
7
by: verbatime | last post by:
Please explain me how this works - or should work: Got my two classes - bcBasic (baseclass) and the derived cBasic. //--------------------------------------- class bcBasic { int number;...
1
by: Knut Vonheim | last post by:
Hi all, I am trying to decide how to best handle exceptions in Business Classes. For example, there are times when public properties have valid ranges of values and enumerations are not...
1
by: wh | last post by:
This is more a question of style really, nothing too technical - honest. My question is what is the preferred way of defining the styles of elements in an asp.net page? Supposing I have...
7
by: tshad | last post by:
I am trying to figure out when it is best to use Interfaces and when to use classes. The only reason I can figure out to use interface is if you need to implement multiple interfaces. The...
2
by: Jeff | last post by:
Using ASP.NET 1.1 I have an <asp:TextBox... for which I set the width property --- "width=30". The textbox is being rendered to the browser like this: <input name="someName" type="text"...
2
by: Tim_Mac | last post by:
hi, i have the following code in an aspx page, inside a server form: <asp:TextBox ID="txtPageTitle" runat="server" dir='<%# this.HtmlTextDirection %>' lang='<%# this.HtmlLanguageCode %>'>...
1
by: 1x7y2z9 | last post by:
Say, we have a (parent) class P. It has N child classes C1(P), C2(P) ... CN(P) Each of the child classes defines (differently) a method func(). I wish to decorate all of the CX.func() in the...
3
by: puzzlecracker | last post by:
Would you quickly remind me the difference between, regular class, static class, and nested class? Thanks
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.