第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何命名Twitter Bootstrap的名稱空間,以免樣式?jīng)_突

如何命名Twitter Bootstrap的名稱空間,以免樣式?jīng)_突

犯罪嫌疑人X 2019-11-25 15:23:39
我想使用Twitter Bootstrap,但僅在特定元素上使用,因此我需要找出一種方法,用我的前綴為所有Twitter Bootstrap類添加前綴,或使用較少的mixins。我對此還沒有經(jīng)驗,所以我不太了解該怎么做。這是我嘗試設(shè)置樣式的HTML的示例:<div class="normal-styles">  <h1>dont style this with bootstrap</h1>  <div class="bootstrap-styles">    <h1>use bootstrap</h1>  </div></div>在此示例中,Twitter Bootstrap會同時使用兩種樣式h1,但是我想對我在哪些方面應(yīng)用Twitter Bootstrap樣式有更多選擇。
查看完整描述

3 回答

?
桃花長相依

TA貢獻1860條經(jīng)驗 獲得超8個贊

您還需要注意,引導(dǎo)程序會修改主體{},主要是為了添加字體。因此,當(dāng)您通過LESS / SASS對其命名空間時,您的輸出css文件如下所示:(在引導(dǎo)程序3中)


.bootstrap-styles body {

    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

    font-size: 14px;

    line-height: 1.428571429;

    color: #333333;

    background-color: white;

}

但很明顯,div內(nèi)不會有body標記,因此您的引導(dǎo)程序內(nèi)容將沒有引導(dǎo)程序字體(因為所有引導(dǎo)程序都從父級繼承字體)


要解決此問題,答案應(yīng)為:


.bootstrap-styles {

    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

    font-size: 14px;

    line-height: 1.428571429;

    color: #333333;

    background-color: white;


    @import 'bootstrap';

}


查看完整回答
反對 回復(fù) 2019-11-25
?
收到一只叮咚

TA貢獻1821條經(jīng)驗 獲得超5個贊

如果將以下內(nèi)容包含在名為“ bootstrap-namespaced.less”的文件中,則只需將“ bootstrap-namespaced.less”導(dǎo)入到其他文件中文件:


// bootstrap-namespaced.less


// This less file is intended to be imported from other less files. 

// Example usage:

// my-custom-namespace {

//  import 'bootstrap-namespaced.less';

// }


// Import bootstrap.css (but treat it as a less file) to avoid problems 

// with the way Bootstrap is using the parent operator (&).

@import (less) 'bootstrap.css';


// Manually include styles using selectors that will not work when namespaced.


@import 'variables.less';


& {

    // From normalize.less


    // Previously inside "html {"

    // font-family: sans-serif; // Overridden below

    -ms-text-size-adjust: 100%;

    -webkit-text-size-adjust: 100%;


    // Previously inside "body {"

    margin: 0;


    // From scaffolding.less


    // Previously inside "html {"

    // font-size: 10px; // Overridden below

    -webkit-tap-highlight-color: rgba(0,0,0,0);


    // Previously inside "body {"

    font-family: @font-family-base;

    font-size: @font-size-base;

    line-height: @line-height-base;

    color: @text-color;

    background-color: @body-bg;

}



查看完整回答
反對 回復(fù) 2019-11-25
  • 3 回答
  • 0 關(guān)注
  • 562 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號