html - Are there any hacks to style based on input value with just CSS? -


for checkboxes it's possible style based on dynamic value like:

input[type="checkbox"] { ... } input[type="checkbox"]:checked { ... } 

and can use :before / :after make dynamic value affect other things on page.

so tried doing same text inputs, selects based on initial value attribute, not on dynamic value:

input[type="text"][value="x"] { ... } 

and there's styling of options, applies display when selection dropdown open (and in chrome, not firefox):

option:selected { ... } 

so there way style document based on text or select's dynamic value pure css?

i know there simple javascript solutions.


Comments

Popular posts from this blog

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -