1

I want to know whether external css files has single line comments or not.

I am using an external css file(styles.css) and i want to use single line comments in that file.I have tried using "//", "#", "--" but none of them worked.I know we can use "/*.....Comments here....*/" in single line but in my case I have to use single line commands. please help.

style.css

//{ strarBlock
.user-title {
    position: relative;
    display: block;
    border: 1px solid #c1bd9e;
    margin-top: -3px;
    background-color: #fafafa;
.......
//} endBlock

//{ strarBlock
.user-details {
    position: relative;
    display: block;
    border: 1px solid #c1bd9e;
    margin-top: -3px;
    background-color: #fafafa;
.......
//} endBlock

2
  • 2
    It's /* ---- */ Commented Nov 3, 2016 at 8:11
  • Thanks @Goombah for your reply. I have edited my question do external style sheet has any single line comments... Commented Nov 3, 2016 at 14:09

2 Answers 2

1

Single line comments in CSS are single line comments:

/* single line comments */

There's no other way.

But you still can use a pseudo vendor prefix to comment properties:

.sample {
    -commented-color: red;
}
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks @Adam for your answer. Could you please explain or suggest a link about "pseudo vendor prefix" and can we use that for any text also..
you can read more about vendor prefix here: developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix You can use this feature to prefix any property with you own vendor prefix (like "-commented-" in this example, this will be ignored by browsers)
Thanks @Adam. It helped me alot.
1

You can use a preprocessor to remove the // comments:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.