I have added the following code style=\"background-color: #C2A5A5 !important
. But that has not worked for me. how can I add background color to ion-item?Thank
Ionic is injecting an element inside the
giving the element a structure of:
The Ionic CSS contains a CSS property:
.item-content {
background-color:#ffffff;
}
The inline CSS you added is being applied to the element behind the element with the #ffffff
background, so you can't see your background color.
Apply the background color to the .item-content
element, as @ariestiyansyah recommended by adding the following CSS to the Ionic CSS file, or create a custom CSS file and include a to it in the header, with the following:
.item .item-content {
background-color: transparent !important;
}
Here's the working demo.