使用 material bootstrap 库更改 Yii2 中的文本颜色不起作用
Changing textcolor in Yii2 with material bootstrap library doesnt work
我正在尝试更改文本的颜色甚至页脚的背景(例如),但在添加 this library 之后,一切都变了,我什至无法更改文本的颜色.
这是我的 MaterialAsset:
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace frontend\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class MaterialAsset extends AssetBundle
{
public $sourcePath = '@themes/material';
public $baseUrl = '@web';
public $css = [
'css/material.min.css',
'css/material-fullpalette.min.css',
'css/ripples.min.css',
'css/roboto.min.css',
'css/site.css',
];
public $js = [
'js/material.min.js',
'js/ripples.min.js',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
我正在尝试在我的 site.css:
中使用它
html,
.footer {
height: 180px;
background-color: #222222;
border-top: 1px solid #eeeeee;
padding-top: 20px;
}
.customtext {
color: white;
}
.wrap {
min-height: 100%;
height: auto;
margin: 0 auto -60px;
padding: 0 0 60px;
}
.wrap > .container {
padding: 70px 15px 20px;
}
.not-set {
color: #c55;
font-style: italic;
}
/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings', fantasy;
font-style: normal;
font-weight: normal;
line-height: 1;
padding-left: 5px;
}
a.asc:after {
content: /*"\e113"*/ "\e151";
}
a.desc:after {
content: /*"\e114"*/ "\e152";
}
.sort-numerical a.asc:after {
content: "\e153";
}
.sort-numerical a.desc:after {
content: "\e154";
}
.sort-ordinal a.asc:after {
content: "\e155";
}
.sort-ordinal a.desc:after {
content: "\e156";
}
.grid-view th {
white-space: nowrap;
}
.hint-block {
display: block;
margin-top: 5px;
color: #999;
}
.error-summary {
color: #a94442;
background: #fdf7f7;
border-left: 3px solid #eed3d7;
padding: 10px 20px;
margin: 0 0 15px 0;
}
关于这行甚至那页脚。
.customtext {
color: white;
}
添加我的索引后:
<p class="text-success customtext">News</p>
但这根本行不通。
如何更改此应用程序中此文本的颜色或页脚颜色?
如果你不能用其他方式,你只能尝试像这样的内联样式
<p style="color: white;">News</p>
我正在尝试更改文本的颜色甚至页脚的背景(例如),但在添加 this library 之后,一切都变了,我什至无法更改文本的颜色.
这是我的 MaterialAsset:
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace frontend\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class MaterialAsset extends AssetBundle
{
public $sourcePath = '@themes/material';
public $baseUrl = '@web';
public $css = [
'css/material.min.css',
'css/material-fullpalette.min.css',
'css/ripples.min.css',
'css/roboto.min.css',
'css/site.css',
];
public $js = [
'js/material.min.js',
'js/ripples.min.js',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
我正在尝试在我的 site.css:
中使用它html,
.footer {
height: 180px;
background-color: #222222;
border-top: 1px solid #eeeeee;
padding-top: 20px;
}
.customtext {
color: white;
}
.wrap {
min-height: 100%;
height: auto;
margin: 0 auto -60px;
padding: 0 0 60px;
}
.wrap > .container {
padding: 70px 15px 20px;
}
.not-set {
color: #c55;
font-style: italic;
}
/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings', fantasy;
font-style: normal;
font-weight: normal;
line-height: 1;
padding-left: 5px;
}
a.asc:after {
content: /*"\e113"*/ "\e151";
}
a.desc:after {
content: /*"\e114"*/ "\e152";
}
.sort-numerical a.asc:after {
content: "\e153";
}
.sort-numerical a.desc:after {
content: "\e154";
}
.sort-ordinal a.asc:after {
content: "\e155";
}
.sort-ordinal a.desc:after {
content: "\e156";
}
.grid-view th {
white-space: nowrap;
}
.hint-block {
display: block;
margin-top: 5px;
color: #999;
}
.error-summary {
color: #a94442;
background: #fdf7f7;
border-left: 3px solid #eed3d7;
padding: 10px 20px;
margin: 0 0 15px 0;
}
关于这行甚至那页脚。
.customtext {
color: white;
}
添加我的索引后:
<p class="text-success customtext">News</p>
但这根本行不通。
如何更改此应用程序中此文本的颜色或页脚颜色?
如果你不能用其他方式,你只能尝试像这样的内联样式
<p style="color: white;">News</p>