Less hack compatible

Source: Internet
Author: User

Less hack compatible

CSS compatibility is inevitable, then use less to write CSS code how to hack it? If you use CSS method to write a similar "\9" in the back of the compiler is to error. Here are the two small methods I tried for reference:

1. First define a variable "/*\**/" when hack with this variable compile will not error:

@hack: ~ " /* \* */  {     [email protected]{hack}: blue\9;}

The compiled CSS code is:

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

2. The second method principle is similar to the first, just the hack symbol "\9" custom variables, add to the end of less code, so that at compile time can generate the full CSS hack code, and will not error.

@hack: ~ "\9"; #box {    background-color:[email protected];}

The compiled CSS code is most familiar to everyone:

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

Less hack compatible

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.