CSS Style Entry Element [type = "??" ] for favorite lists

Possible duplicate:
CSS Select Selector

What is CSS equivalent to the following when working with picklists?

input[type="text"]
input[type="submit"]
+5
source share
5 answers

The CSS selector input[type="text"]can be broken down into:

  • input; find all the elements that are elements input.
  • [type="text"]; filter these elements by those that have an attribute type text.

Since the select box is an element <select>, not a <input type="select" />, you can simply use the selector selectas follows:

select {
    /* blah blah blah*/
} 
+21
source

select , , , select

+4

As Fabrizio Calderan says, select does not have a type property. however, you can use the data property and style your element based on this

see here: Choosing elements by data attribute in CSS

Why not use a class for its styles?

Pseudocode:

<select>
    <option class="wise">
    <option class="not-so-wise">
    <option class="meh">
</select>
+2
source
select {
   border:1px solid green; 
}

  select option {
     font-weight:bold; 
  }
+1
source

select

-4
source

All Articles