我正在使用带有Sass的Bootstrap 4进行Angular 4项目,我想使用glyphicons但是当我使用以下代码时:
<button class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-thumbs-up"></span>Like</button>
Run Code Online (Sandbox Code Playgroud)
例如,在制作"喜欢"按钮时,图标不会显示.
我配置项目以使用ng-serve
命令编译SCSS样式表,我angular-cli.json
看起来像这样:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "front-end-informatorio"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/bootstrap/scss/bootstrap.scss",
"../node_modules/bootstrap/scss/main.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json", …
Run Code Online (Sandbox Code Playgroud) 我有一个Bootstrap按钮,我在样式表中覆盖了样式,因为我想让按钮变暗,现在按钮有一个悬浮效果来自Bootstrap,我怎么能摆脱它?请参阅下面的代码段以获取结果:
.btn-dark {
min-width: 100px;
background-color: black;
color: white;
border-radius: 1px;
text-decoration: none;
opacity:1.0;
box-shadow:none;
}
Run Code Online (Sandbox Code Playgroud)
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<a href="#" class="btn btn-dark space hvr-pulse tog1" data-toggle="modal" data-target="#exampleModalCenter"><i class="fab fa-telegram-plane"></i> SEND US A MESSAGE</a>
Run Code Online (Sandbox Code Playgroud)
问题是,<p>
并且<h1>
出现在同一条线上,无论我做什么,它们都无法居中.
HTML
<div class="container">
<div class="row" id="appSummary">
<h1>Why This App Is Awesome</h1>
<p class="lead">Summary, once again, of your app's awesomeness</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#appSummary{
text-align:center;
}
Run Code Online (Sandbox Code Playgroud)