@semicolon posted a new topic, subject "Would someone explain what this CSS (whatever it is) code means?". It read:

   eg:
    [code] 
        <b>position: relative</b> }              /* 1 */
        
    [/code]
    
    Kinda hard to see, it's that faint bit hanging out to the right, namely:
    
    # `/* 1 */`
    
    ? Thanks everyone.

So @chrisofarabia replied

    It's a HTML comment. If you put those around either code or content, a browser won't make any use of it - in this case the number 1 won't get displayed.
    
    I'm not too sure about that spare curly brace though - is this just a snippet from a larger piece of code?

After which, @RyanReese added

    chrisofarabia:
    
    > It's a HTML comment.
    
    Try again  .

After which, @RyanReese added

    chrisofarabia:
    
    > I'm not too sure about that spare curly brace though - is this just a snippet from a larger piece of code?
    
    It would presumably mark the end of the declaration block/rule.

@chrisofarabia replied

    whoops, my bad…
    
    Let's try a CSS multi-line comment then.

After which, @RyanReese added

    chrisofarabia:
    
    > Let's try a CSS multi-line comment then.
    
    Yup  . I should note that there are no single-line comments in CSS as well (as to not give OP the wrong idea.)
    
    I'm nitpicky; sue me.

@molona replied

    RyanReese:
    
    > sue me.
    
    Where do I need to send the notification?

@RyanReese replied

    molona:
    
    > Where do I need to send the notification?
    
    This must be serious. Spain vs Ryan Reese.

To which @molona replied

    RyanReese:
    
    > Spain vs Ryan Reese.
    
    Wow. I didn't know I was so important that I could count for a whole country

To which @Michael_Morris replied

    RyanReese:
    
    > I should note that there are no single-line comments in CSS as well (as to not give OP the wrong idea.)
    
    Sass and Less both implement them though. They won't be included in the CSS output.

@semicolon replied

    Christopher Walken.  
    Christopher Sitting.

After which, @semicolon added

    Alright I don't know where this post will be placed because I don't know where the bottom of my thread is . . . I just wanted to thank everyone for explaining that this is a “Comment”. I was going to include a link for future reference (mine or anyone else's) but I swear I couldn't find this turkey — 
    
    # `/* Turkey */`
    
      
    — without entire paragraphs qualifying it one way or another. It's 4 lousy keystrokes! Write an example already! 
    
    And if the following is also a “Comment” — 
    
    #  `<!-- Son of Turkey -->`
    
    then I don't know why I couldn't find **two simple examples** with Google. I'll leave because I'm in a pissy mood. Thank you everyone.

After which, @Erik_J added

    > I was going to include a link for future reference (mine or anyone else's)
    
    /* CSS block or line comment */
    
    <! – HTML comment -->
    
    // Javascript line comment and  
    /* Javascript block  
    comment */
    
    > then I don't know why I couldn't find two simple examples with Google.
    
    Tags are not content for a search engine, thats why. And I don't know any global code search engine thats available without an account, sorry.

@Mittineague replied

    There's also
    
    # “hash” comments
    
    and
    
    **;** semi-colon comments

@Erik_J replied

    REM comments not to mention

After which, @SamA74 added

    Erik_J:
    
    > // Javascript line comment and
    
    // also works in PHP

After which, @felgall added

    SamA74:
    
    > // also works in PHP
    
    /* so does this */
    
    `#` and so does this

To which @RyanReese replied

    Heck, we need to list every language, preprocessor, postprocessor, variation language, etc, ever invented and list the comments. Let's go.

So @Paul_Wilkins replied

    RyanReese:
    
    > Heck, we need to list every language, preprocessor, postprocessor, variation language, etc, ever invented and list the comments. Let's go.
    
    I refer you to http://en.wikipedia.org/wiki/Comment_(computer_programming)

After which, @molona added

    You mean for the main programming languages on the web… For Visual Basic, commeting is done using an apostrophe
    [code] 
        ' This is a VB comment
    [/code]

So @system replied

    This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.


{'source': 'discourse', 'url': 'https://www.sitepoint.com/community/t/would-someone-explain-what-this-css-whatever-it-is-code-means/190104', 'title': 'Would someone explain what this CSS (whatever it is) code means?', 'views': 1566, 'has_accepted_answer': False, 'word_count': 687, 'like_count': 3, 'reply_count': 14, 'participant_count': 10, 'posts': 21, 'tags': '', 'author': '@semicolon', 'participants': '@semicolon, @chrisofarabia, @RyanReese, @molona, @Michael_Morris, @Erik_J, @Mittineague, @SamA74, @felgall, @Paul_Wilkins, @system', 'image_url': [None], 'created_at': '2015-05-18T19:54:49.246Z', 'last_posted_at': '2015-08-20T14:57:16.896Z'}