LESS-CSS Base Extension

Source: Internet
Author: User

//Extend the Pseudo-class of the extendless, combining the selector and placing it on the selector that matches it reference use Method: Take the style of extending test on study as an example. Test{Color:#000000;font-size:18px;}//grammar 1.study{&:extend (. Test);background:Red;}//grammar 2.study:extend (. Test){background:Red;}//Output Css.test,.study{Color:#000000;font-size:18px;}. Study{background:Red;}//Extension Alluse Method: To extend the test on study as an example when there is all, it is extended together with all the children under test. Test{Color:#000000;font-size:18px;li{Width:50px;Height:50px;background:Red; }}//grammar 1.study:extend (. Test all){}//grammar 2.test{&:extend (. Test all);}//Output Css.test,.study{Color:#000000;font-size:18px;}. Test Li,.study Li{width:50px;Height:50px;background:Red;}when none is expanded only the selected selector style//grammar 1.study:extend (. Test){}//grammar 2.study{&:extend (. Test);}//Output Css.test,.study{Color:#000000;font-size:18px;}. Test Li{width:50px;Height:50px;background:Red;}Summary: The extension, in short, is a common style in CSS The above example illustrates: study has the exact same style as in Test, in order to simplify the code, we extend the study directly

Leona

Original link: http://www.cnblogs.com/leona-d/p/6296162.html

Copyright NOTICE: This article is copyright to the author and the blog Park is shared, welcome to reprint, but without the consent of the author must retain this statement, and in the article page obvious location to give the original link

LESS-CSS Base Extension

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.