我正在嘗試BootStrap在Angular專案中使用,并且能夠在專案的索引檔案中使用以下內容在前端呈現樣式:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
到目前為止還不錯,但試圖按照此鏈接呈現樣式,而無需在帶有 Angular的索引檔案BootStrap 中進行參考。所以在 angular.json 檔案中添加了以下行:
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
]
我相信,這就是之前的鏈接所做的。我不確定我是否在這里遺漏了什么?我所做的是以下并且不呈現按鈕樣式:
<button type="button" class="btn btn-primary">Add</button> //Though the class name doesn't show while writing
uj5u.com熱心網友回復:
您必須禁用封裝
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
})
export class AppComponent {}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/375585.html
標籤:有角的 推特引导 角cli bootstrap-5
