wrap a .less css definitions in a namespace

前端 未结 5 556
情话喂你
情话喂你 2020-12-24 07:31

I wanted to use twitter bootstrap CSS only in a specific element in my web page.

I tried to do it like in code below. But after compiling this to a css file nothing

5条回答
  •  囚心锁ツ
    2020-12-24 08:01

    I am not using less on the live site, nor am I manually doing the compiling so this is kind of a "simple" version. It's not as automated as the others but may apply to some users.

    1. Edit bootstrap.css / bootstrap-responsive.css

      .tb {
        // copy/paste the entire bootstrap.css
      }
      
    2. Recompile with less or use an online less compiler - http://winless.org/online-less-compiler

    3. Edit the now-compiled file and change body {} CSS declarations to tb {}.

    4. Use the new CSS file.

    5. Place your "bootstrapped" content inside a

提交回复
热议问题