Defining and using a class in CSS. About spaces

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peterbiggs
    New Member
    • Sep 2009
    • 2

    Defining and using a class in CSS. About spaces

    The question is about spaces.
    1. If the code is:
    <a class="title newProduct " href="clinician s_rem_sleep_60. html">test here</a>

    Q. Is the class "title newProduct " recognised?
    I ask this because it the two words are separated by a space and it has a trailing space.
    I had always thought that the class name should contain no spaces at all!
    cheers
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Originally posted by peterbiggs
    I had always thought that the class name should contain no spaces at all!
    a class name must not contain any spaces, yet the code is correct. there simply are two classes.

    Comment

    • peterbiggs
      New Member
      • Sep 2009
      • 2

      #3
      Then are ALL spaces ignored?

      Thanks for that. I appreciate it! It's driven me crazy trying to find a tutorial that includes this issue.
      So. Any leading & trailing spaces are then ignored, and the separating space(s) just 'separate' the two (in this case) class names.
      That makes life easy then!

      Comment

      Working...