3

I have seen a number of posts similar to this, but I haven't found anything that works for me.

I have an Ionic2 application, where I have a style I want to get rid of.

This is what I can see..

enter image description here

and I wish to get rid of the background-image

It would be good to be able to do it using an Id (I only want this on this one element, and not others that may have these classes), but I have also tried the following...

.ion-header.header.header-md:after{
   background-image: none;
  }

I don't know why the following does not work.

Anyone have any suggestions?

Thanks in advance!

2
  • 1
    You may need to use ::after (CSS3 syntax)? Also, are your styles loaded before or after the main.css? Commented Feb 11, 2017 at 11:03
  • 2
    ion-header is an element, not a class. Commented Feb 11, 2017 at 11:04

1 Answer 1

3

Basically you have 2 options:

  1. Use !important rule.


.header-md:after,
tabbar:after,
.footer-md:after {
 background-image: none !important;
}
  1. Override original styles.


.header-md:after,
.tabs-md[tabsPlacement="top"] > tabbar:after,
.footer-md:before,
.tabs-md[tabsPlacement="bottom"] > tabbar:after {
  background-image: none;
}
Sign up to request clarification or add additional context in comments.

2 Comments

The above worked perfectly. Also, I found as also mentioned ion-header is an element, not a class, so even ion-header.header.header-md::after{ background-image: none; } actually worked.
Yes, but I don't recommend this. stackoverflow.com/a/5970136/3258604

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.