I'm trying to define a custom table in css that won't effect other tables not specified by the class. I confused about the naming convention, I've seen both, but is there a difference between these:
table.rc { }
rc table { }
Thanks
I'm trying to define a custom table in css that won't effect other tables not specified by the class. I confused about the naming convention, I've seen both, but is there a difference between these:
table.rc { }
rc table { }
Thanks
table.rcmeans any table with the class value rc
rc tableis wrong. I'm guessing you mean.rc tablewhich means any table within any element with a class value rc
Class values always start with a period when you target them in CSS. If a class value is attached at the end of an element (element.class) it means that the element much have that class value to be targeted.
If there are two elements in a row with a space in between (element element) it means that the second element much be a child of the first element to be targeted.
When having class values without any element (.class) it means that any element with that class value is targeted.
So for instancediv.wrap .nav li a.hometargets all anchor tags with a class value of home (a.home) that are child elements to any list items (li) that are child elements to any elements with a class value of nav (.nav) that are child elements to any divisions with a class value of wrap (div.wrap).
So in your case, if you want to target a specific table, you could give the table a class value and then usetable.classvalue
I hope that is clear enough, if not, just ask.
Good luck!
If you want to define a table type that does not affect other tables you make a class, using your example table.rc{}
In your HTML you use this class by <table class="rc>
I must admit to not having seen this expressed as 'rc table', I tested it out and it did not appear as a class this way.
Bookmarks