I have this issue that the input tag has a class that's the same as other input tag.
I want to change the icon to something else but it affects the other input that's not related to the icon.
I wonder if it is possible to create a css based on the input's div parent.

<div id="search">
  <input type="submit" id="edit-submit" name="op" value="Search" class="form-submit">

so in CSS i would like to link the .form-submit class to the div#search so it does not affect other inputs.
I was thinkig of something like this


but this does not work.

Thank You.


I solved my issue
It was simple, but the only thing i didn't try

div#search input#edit-submit.form-submit

So, the only thing missing was a space.

I posted the answer for someone who'll find this post and find it useful.

Is there a form to make the reverse of this. That is, I want to modify the #search parent based on the .form-submit child value.

So, for the example in the last post, I want the css to modify the div#search and not the input#edit-submit.form-submit but this should be the condition for it to modify.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.