#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    26
    Rep Power
    0

    Question Prevent CSS Inheritance....


    I have a table that uses style sheets:
    <table class="Border">
    but then when I place a table inside of it, it inherits the same class. Is there a way to prevent this?

    Thanks!
    Scott.
  2. #2
  3. This tagline is not long enoug
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Location
    Toronto, ON Canada! I AM CANADIAN
    Posts
    863
    Rep Power
    16
    make a new class that specifies what you want it to be, and apply that class to the instantiated table.

    edit: try using lowercase names for css also. It's only good form right now.
  4. #3
  5. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    Originally Posted by 1beb
    edit: try using lowercase names for css also. It's only good form right now.
    there is nothing wrong in using uppercase letters in the classnames,
  6. #4
  7. This tagline is not long enoug
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Location
    Toronto, ON Canada! I AM CANADIAN
    Posts
    863
    Rep Power
    16
    Is it just the tags that have to be lower case for a completly compliant doc, then? I was under the impression ( from the w3c validator ) that everything had to be lower case.
  8. #5
  9. This tagline is not long enoug
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Location
    Toronto, ON Canada! I AM CANADIAN
    Posts
    863
    Rep Power
    16
    Paraphrased... --> http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html...

    It's a worthwhile read, it actually explains a couple of things that you were trying to explain to me in a couple of my earlier posts...

    Actually, CSS is parsed differently attached to HTML pages, CSS selectors (classnames) are case-insensitive. But when attached to XML pages (including XHTML pages served with the proper XHTML MIME type), CSS selectors are case-sensitive. This shouldn't come as too much of a surprise; everything in XML is case-sensitive. Keep all your CSS selectors lowercase and you'll be okay.
    I guess it really doesn't matter in the long run if your are designing in < xhtml.
  10. #6
  11. Über nübe
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Babylon 4
    Posts
    240
    Rep Power
    12
    I like to keep everything lowercase (including CSS class names).
    Hello, old friend...
  12. #7
  13. Thanks Johnny Hart (BC) R.I.P.

    Join Date
    May 2003
    Location
    Dallas
    Posts
    5,268
    Rep Power
    1956
    I guess it really doesn't matter in the long run if your are designing in < xhtml.
    Actually, the only reason to use all lowercase is consistancy. With a consistent capitalization convention, you are less likely to make errors. As an example, you might settle on camel notation; #navCol, or .contentHeadings. If you do it consistantly, errors are less likely and typos easier to spot. The same applies should you decide on all lowercase or another convention. Lowercase is obviously the simplest and easiest convention to follow.

    HTML elements should always be lowercase for forward compatibility, if nothing else.

    cheers,

    gary
    Last edited by kk5st; May 13th, 2004 at 01:07 AM.
    There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

    My html and css workshop, demos and tutorials.
    Ask a better question, get a better answer.

IMN logo majestic logo threadwatch logo seochat tools logo