Less hack compatibility, lesshack

Source: Internet
Author: User

Less hack compatibility, lesshack
Less hack compatibility

Css compatibility is inevitable, so how to hack when writing css code with less? If the css method is used to directly write a code similar to "\ 9", an error is returned. The following are two small methods I have tried for your reference only:

1. First define a variable "/* \ **/" and add this variable to the hack to compile the variable. No error will be reported:

@ Hack :~ "/* \ **/"; # Box {background-color @ {hack}: blue \ 9 ;}

The compiled css code is:

# Box {background-color/* \ **/: blue \ 9 ;}

2. the principle of the second method is similar to that of the first method. It just defines the hack symbol "\ 9" as a variable and adds it to the end of the less code so that the complete css hack code can be generated during compilation, no error is reported.

@ Hack :~ "\ 9"; # box {background-color: blue @ hack ;}

The compiled css code is the most familiar one:

# Box {background-color: blue \ 9 ;}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.