question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not override css classes

See original GitHub issue

Reproduction link

https://stackblitz.com/edit/angular-md42sr?file=src/app/app.component.ts

Steps to reproduce

1- trying to add label float to left in component css based on simple form

What is expected?

label will be floated to left

What is actually happening?

css and other css rules are not reflected in the code

Environment Info
ng-zorro-antd 7.2.0
Browser chrome

it happens with all CSS ruled I trying to override, for example, ant-alerts-warning … and a lot of class that are not be overridden and I don’t see them in the console

How do I affect generaly on child component of ant

my angular json

      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.ico",
              "src/favicon.png",
              "src/favicon.icns",
              "src/favicon.256x256.png",
              "src/favicon.512x512.png",
              {
                "glob": "**/*",
                "input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
                "output": "/assets/"
              }
            ],
            "styles": [
              "src/theme.less",
              "src/styles.scss"
            ],
            "scripts": []
          },

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
DepickereSvencommented, Dec 17, 2019

You can override CSS class by using the deep selector example:

::ng-deep .ant-table.ant-table-default 

    { 
          padding: 16px; 16px

    }

Source: https://stackoverflow.com/questions/58181488/how-to-change-styles-of-nz-table-in-ng-zorro

1reaction
dilipsinhrathodcommented, Dec 5, 2020

Thank you so much Bro DepickereSven +1:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't override css of element
A rule that has the !important property will always be applied no matter where that rule appears in the CSS document.
Read more >
How to Edit, Customize, and Override Bootstrap CSS ...
Learn how to override Bootstrap CSS using simple CSS overrides or Sass variables and maps to customize your site.
Read more >
Css override not working
Hello,. I'm trying to override (display: inline-block; ) in Basic.css file by creating a class in my own css file:
Read more >
Techniques to prevent CSS override by base application
And then, I'll talk about what are the chances that base application(s) will use these methods of styling that can possibly override your...
Read more >
How to Override CSS Styles
Example of overriding CSS style with the Class selector: ... Here, the Class selector overrode the ID selector because it was the last...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found