Results 1 to 5 of 5

Thread: How to comment CSS code with comments inside ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to comment CSS code with comments inside ?

    Qt Code:
    1. /*
    2.  QComboBox::drop-down {
    3.   subcontrol-origin: padding;
    4.   subcontrol-position: top right;
    5.   width:18px;
    6.  
    7.   border-left-width: 1px;
    8.   border-left-color: red;
    9.   border-left-style: solid; /* just a single line */
    10. border-top-right-radius: 3px; /* same radius as the QComboBox */
    11. border-bottom-right-radius: 3px;
    12. }
    13. */
    To copy to clipboard, switch view to plain text mode 
    At style editor on Designer this is an invalid style..
    Also , as you can see, the post is seen with black and red colors because the "border-left-style: solid; /* just a single line */" line re-open valid data ... ??

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to comment CSS code with comments inside ?

    This is invalid style, that's correct. Multiline comments can't be nested. If you need a nested comment, use a single line version inside a multiline one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to comment CSS code with comments inside ?

    Also, note that CSS does not support a separate single-line comment. It also expressly forbids nested comments. So you cannot do what you're attempting in CSS. You will have to remove the inner comments if you want the section to remain valid.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to comment CSS code with comments inside ?

    CSS might not support it however some browsers do
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to comment CSS code with comments inside ?

    True, but the spec is quite clear that single-line comments aren't supported, so it's best not to use them in the first place. Cross-browser debugging of this sort of thing is not fun, and browsers are becoming more and more standards-compliant as time goes on - even IE.

Similar Threads

  1. Qt 5 comments??
    By nish in forum General Discussion
    Replies: 11
    Last Post: 11th May 2011, 18:44
  2. Replies: 3
    Last Post: 18th October 2010, 17:34
  3. Changing a file extension inside the code
    By fortyhideout12 in forum Qt Programming
    Replies: 6
    Last Post: 19th February 2010, 21:20
  4. How to step inside(debug) webkit code?
    By nish in forum Qt Programming
    Replies: 5
    Last Post: 30th December 2009, 12:23
  5. Code comments
    By zlatko in forum General Programming
    Replies: 9
    Last Post: 9th February 2006, 08:27

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.