tklustig
(Kipp Thomas)
August 9, 2017, 10:11pm
1
Hi guys, a simple question:
Which CSS file contains rules for my automatically generated div-class:
<div class="container">
<?=
Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
])
?>
<?= $content ?>
</div>
I searched in my IDE for container and found dozen of files,inter alia this file:
bootstrap.css
I deleted it, but nothing changed.
Looking to my browser shows up css files in folder web/asset. Deleting them is absolutely pointless -they will be regenerated again!
Any ideas,where to change rules for div-class container?
patrickm
(Yiiframework)
August 10, 2017, 1:39pm
2
It’s a default class in Bootstrap: http://getbootstrap.com/css/#grid-intro
You can use your browser’s developer tools to find out which file the definitions are coming from.
jkofsky
(Jkofsky)
August 10, 2017, 10:25pm
3
tklustig:
Hi guys, a simple question:
Which CSS file contains rules for my automatically generated div-class:
<div class="container">
<?=
Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
])
?>
<?= $content ?>
</div>
I searched in my IDE for container and found dozen of files,inter alia this file:
bootstrap.css
I deleted it, but nothing changed.
Any ideas,where to change rules for div-class container?
In your site.css. Add .breadcrumb {}. change to your hearts content
If you look at the source code in the browser, you’ll see that bootstrap.css is loaded from an /asset folder. I would NOT delete it, as you would loss ALL bootstrap styles.
alirz23
(Ali Raza)
August 11, 2017, 1:02pm
4
you can override the container styles in your site.css file under web/css/
tklustig
(Kipp Thomas)
August 11, 2017, 9:52pm
5
No, that’s not the file I can influence div class container
Furthermore,whatever I delete in folder web/asset, it will be generated again,automatically. My problem still is not solved :=(
bobonov
(Bobonov)
August 12, 2017, 8:22am
6
I think you misunderstood @alrazi answer. In this file, site.css, you can put css rules to override main css rules.
if you want to override css rules for generic div element
div {
border: 1px solid #000000;
}
the above code will add a black border to all div.
tklustig:
Furthermore,whatever I delete in folder web/asset, it will be generated again,automatically. My problem still is not solved :=(
Files in web/asset are file generated by the yii2 framework based on what your application and extension register as assets.
If you delete them they get generated again.
boostrap.css is in the package boostrap package under
vendor/bower/bootstrap/dist/css/bootstrap.css
You should NEVER modify files under vendor , any change you do here will be lost at next composer package update.
tklustig
(Kipp Thomas)
August 12, 2017, 1:40pm
7
So,what is central configuration file,where I can define my rules:
bootstrap.css or site.css?
I momentary changed rules in css file shown up my my browser,which is in folder
E:\xampp\htdocs\Yii2_Mail\frontend\web\assets\b35a0bf8\css\bootstrap.css.
There I did well changing container style, but if it’s gonna deleted time by time, I’m not sure!
bobonov
(Bobonov)
August 14, 2017, 2:14pm
8
E:\xampp\htdocs\Yii2_Mail\frontend\web\assets\b35a0bf8\css\bootstrap.css.
worst place where to make the change, change here will always get lost.
tklustig:
So,what is central configuration file,where I can define my rules:
bootstrap.css or site.css?
The bootstrap.css is the official bootsrap css file which is in the bower/bootstrap package
NEVER NEVER NEVER touch this file
If you look at your pages html code you will see that site.css is always the last css loaded, therefore any css rule in this file will override the ones in any previous css files.
This file is under web/css/site.css
This is the place for any css personalization.
tklustig
(Kipp Thomas)
August 20, 2017, 12:13pm
9
E:\xampp\htdocs\Yii2_Mail\frontend\web\assets\b35a0bf8\css\bootstrap.css.
worst place where to make the change, change here will always get lost.
The bootstrap.css is the official bootsrap css file which is in the bower/bootstrap package
NEVER NEVER NEVER touch this file
If you look at your pages html code you will see that site.css is always the last css loaded, therefore any css rule in this file will override the ones in any previous css files.
This file is under web/css/site.css
This is the place for any css personalization.
All right. So, I have to remind overwriting css rules is principal approach defining css rules in yii-framework ?!
Thx a lot. This thread has been solved, but unfortunately this is still unsolved…