How can I use the style input of p-checkbox to change the border and background color of a checkbox?
I already tried [style]="{'background': '#ff0000'}". But this only applies the style to the div which holds the actual checkbox. So its useless. Instead I need to change the border-color and background of the div which has the classes p-checkbox-box and p-highlight.
Note: I cant use CSS here because the colors are dynamic and dependant on the content.
primeng how to inline style checkbox?
486 views Asked by hemmoleg At
1
There are 1 answers
Related Questions in HTML
- How to store a date/time in sqlite (or something similar to a date)
- How to use custom font during html to pdf conversion?
- Storing the preferred font-size in localStorage
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- Is there any way to glow this bulb image like a real light bulb
- With non-graphical maps in Leaflet, zoomDelta doesn't work
- What can I do to improve my coding on both html and css
- Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
- Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
- Displaying a Movie List on a Website Using Jinja2 and Bootstrap
- How to redirect to thank you page after submitting a Google form embedded into a Google Site?
- Storing selected language in localStorage
- Fences (parenthesis, braces) in HTML and MathML
- Understanding Scroll Anchoring Behavoir
Related Questions in PRIMENG
- How to use PrimeNG multiselect search to trigger an API call based on user search input and populate the multiselect with the retrieved data?
- how to show multiple rows per page using PrimeNG carousel?
- Where does this PrimeNG element get its color and how do I change it?
- Issue with PrimeNG Library in Angular
- Primeng Angular styles on subdomain don't work
- Lost PrimeNg styling after upgrade to version 16
- primeng - focus not advancing when tabbing through form / p-dropdown
- how to create a mouseEvent with target in typescript without dispatching?
- PrimeNg paginator wont display "Entries per page" or Showing entries per page
- Display only active item with PrimeNG Steps
- How to get menu item from ptree when leaf = true?
- PrimeNG's styles are not being applied even if my order is correct in angular.json file. "styles.scss" is overriding it
- Customizing TabMenu or TabView in PrimeNg in Angular
- PrimeNG p-table lazy load does not update without extra 'click'
- primeng tabview scroll arrows not showing
Related Questions in PRIMENG-CHECKBOX
- Angular Selected list data using checkbox persist without using table in primng
- primeng how to inline style checkbox?
- Preselect checkboxes in primeng table
- Long list of PrimeNG Checkboxes destroys the whole page layout
- Primeng checkbox checked issue angular
- PrimeNG p-checkbox - Add asterisk mandatory sign after label
- Identify the p-checkbox where an event occurs in Angular
- Check if PrimeNG checkbox checked or unchecked
- PrimeNG checkbox not getting checked by default
- Disabling PrimeNG checkbox
- PrimeNG - Checkbox value as number
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You can use renderer2 to manipulate DOM elements and then add style:
Get all checkboxes using
document.getElementsByClassName('p-checkbox-box')Iterate over each element and add the style you want using
renderer2.setStyle()try this piece of code and add it in
ngAfterViewInit():