Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
How can I change CSS generated by Bootstrap in an Angular app?

I'm new in Angular and Bootstrap

Actually I have this in my Browser :

Browser Code through inspect

and this in my code

<ng-template #newSlaVmData let-modal>
          <div class="modal-header modal-slaVMData">
            <h4 class="modal-title" id="modal-basic-title">
              Add
            </h4>
            <button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
              <span aria-hidden="true">
                ×
              </span>
            </button>
          </div>

As you can see, some code are generated by Bootstrap.

I want to know how can I change the CSS of "modal-dialog" (Browser code) ?

I tried different methods like adding this class in my SCSS file but it didn't work.

I use these dependencies:

"@ng-bootstrap/ng-bootstrap": "^9.1.3"
"bootstrap": "^4.6.0",
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

You should use ::ng-deep pseudo-class to disable view-encapsulation. Add this to your .scss file:

::ng-deep .modal-dialog {
  margin-top: 100px;
  width: 500px;
}
about 4 years ago · Juan Pablo Isaza Report

0

you can just simply overwrite the classes used by bootstrap, like this:

.modal-dialog {
  background-color: black;
}

it's important to load your css file after the bootstrap css

about 4 years ago · Juan Pablo Isaza Report

0

You can add style after the class like

<div class="modal-dialog" style="color:white"></div>

This will override the bootstrap class.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!