Yii Framework Forum: CSS -File containing a special div element - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CSS -File containing a special div element [solved]

#1 User is offline   tklustig 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 20-April 17

Posted 09 August 2017 - 05:11 PM

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?
0

#2 User is offline   Patrick Jones 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 490
  • Joined: 14-July 12
  • Location:Berlin

Posted 10 August 2017 - 08:39 AM

It's a default class in Bootstrap: http://getbootstrap....css/#grid-intro

You can use your browser's developer tools to find out which file the definitions are coming from.
Freelance developer for hire - send me a message!
0

#3 User is offline   jkofsky 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 662
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 10 August 2017 - 05:25 PM

View Posttklustig, on 09 August 2017 - 05:11 PM, said:

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.
Do, or do not. There is no 'try.' Jedi Master Yoda
0

#4 User is offline   alrazi 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,309
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 11 August 2017 - 08:02 AM

you can override the container styles in your site.css file under web/css/
1

#5 User is offline   tklustig 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 20-April 17

Posted 11 August 2017 - 04:52 PM

View Postalrazi, on 11 August 2017 - 08:02 AM, said:

you can override the container styles in your site.css file under web/css/

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 :=(
0

#6 User is offline   Roberto Braga 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 174
  • Joined: 18-February 13
  • Location:Roma, Italy

Posted 12 August 2017 - 03:22 AM

View Posttklustig, on 11 August 2017 - 04:52 PM, said:

No, that's not the file I can influence div class container


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.

View Posttklustig, on 11 August 2017 - 04:52 PM, said:

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.
0

#7 User is offline   tklustig 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 20-April 17

Posted 12 August 2017 - 08:40 AM

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!
0

#8 User is offline   Roberto Braga 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 174
  • Joined: 18-February 13
  • Location:Roma, Italy

Posted 14 August 2017 - 09:14 AM

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.

View Posttklustig, on 12 August 2017 - 08:40 AM, said:

So,what is central configuration file,where I can define my rules:
bootstrap.css or site.css?


bobonov said:

In this file, site.css, you can put css rules to override main css rules.


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.
1

#9 User is offline   tklustig 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 20-April 17

Posted Today, 07:13 AM

View PostRoberto Braga, on 14 August 2017 - 09:14 AM, said:

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...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users