0

So I have a CSS selector for a completely separate dialog in my application called "wizard-grid". This selector is nowhere in the HTML for this file, yet for some unknown reason the browser seems to be ignoring the parent selectors and inheriting from "select" for my dropdowns on this page. These files are minified, could that have something to do with it?

I even did a search in my entire project and the only place where the "wizard-grid" class is mentioned is in one CSS file and one HTML file that are not related to this page. I put a picture of what the broswer is interpreting below:

enter image description here

  • 1
    It's not inheriting from wizard-*, notice **select** is darker color than the others? Since you have it in there with `*, select, *` it's hitting all `select` elements globally. – Chris W. Oct 03 '19 at 21:37

1 Answers1

1

There are 3 separate selectors there, separated by comma. The "parent" selectors only apply to the input, not to the select or .search

.wizard-grid .wizard-body input
select
.search

I'm guessing what you probably want is this. You must have a mistake in your CSS somewhere.

.wizard-grid .wizard-body input
.wizard-grid .wizard-body select
.wizard-grid .wizard-body .search
andrewtweber
  • 22,739
  • 21
  • 84
  • 107
  • Oh, so just to clarify, you can't have multiple selectors inherit from one parent via commas? That makes perfect sense..brain fart. thank you –  Oct 03 '19 at 21:45
  • @p32094 yes that's correct. If you're not already, you should look into using sass. Provides lots of benefits over plain CSS, including inheritance, variables, and functions. The inheritance makes mistakes like this less likely to occur – andrewtweber Oct 03 '19 at 23:49
  • I use LESS for my other projects. I actually had been using only LESS for a month or two on another project, (maybe that’s why I forgot haha). this project is fairly large and already using too much vanilla CSS. Thanks again! –  Oct 05 '19 at 00:55
  • 1
    @p32094 cool, and yeah this seems to be one of those things that happens much more often after you’ve started using SASS/LESS and then have to switch back to vanilla CSS haha – andrewtweber Oct 05 '19 at 02:03
  • exactly. Thanks so much for pointing out my mistake, haha. This is why stack overflow is the best for brain fart moments –  Oct 06 '19 at 03:06