Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Possible use case for ID selector in CSS? Reply To: Possible use case for ID selector in CSS?

#158009
magicspon
Participant

If you are using the attribute selector and you have multi search inputs on the page which need to have various styles, then you are going to have to use classes to overwrite those styles.

If I were you I’d just apply a class to each of your input fields.

If they all have some shared styles you could use the input[type=search] selector for just those bits.

input[type=search]  {
  font: arial;
}

.search-primary {
  color: blue;
}

.search-secondary {
  color: yellow;
}

have fun…