Results 1 to 3 of 3

Thread: CSS - should it be written as all lowercase?

  1. #1
    Join Date
    Dec 2005
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default CSS - should it be written as all lowercase?

    Hi,
    I'm currently in an argument with a developer.

    I say that all css should be written lower case - in the css file and when referenced in the html.

    He says that it can have upper cases in it so it reads more easily.

    E.g.
    Code:
    <class="tablemargin">
    or
    Code:
    <class="TableMargin">
    Who is right? If anyone?
    Mark

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by Skinnybobb View Post
    Code:
    <class="tablemargin">
    or
    Code:
    <class="TableMargin">
    CSS is case-sensitive, therefore both of your examples are correct; They are just two different references.

    Code:
    <style type="text/css">
    element.tablemargin {/* lowercase styles */}
    
    element.TableMargin {/* Firstcase styles */}
    </style>
    
    <element class="tablemargin"> ... </element>
    
    <element class="TableMargin"> ... </element>

  3. #3
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hello

    Not only CSS class should be case sensitive!

    Though i have not tried as you have said, but according to me class name can be differentiated with upper and lower case.

    I think this should help you

    Good Day
    Last edited by Snookerman; 08-02-2009 at 05:49 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •