Brandom
Brandom

Reputation: 25

CSS - wordpress how to change the drop down element's font style

I'm trying to change the font of the elements on all my drop down lists. I want to keep the font of the title of the drop down list but change the font of the elements inside it. I'm using a present in wordpress so I took the class code from google devtool but I tried to write the css . I can't change the html code because are presets.

<select id="pa_mat" class="" 
name="attribute_pa_mat" 
data-attribute_name="attribute_pa_mat" 
data-show_option_none="yes">
<option value="">Elige una opción</option>
<option value="foam" class="attached enabled">FOAM</option>
<option value="pvc" class="attached enabled">PVC</option></select>

css

option.attached enabled{
            font-family: Montserrat;
    font-weight: 700;
}

I'm trying to do something as the picture attached.

Example

enter image description here

thanks in advance to everyone

Upvotes: 0

Views: 179

Answers (1)

MeltingDog
MeltingDog

Reputation: 15404

You need to chain the CSS selectors, like:

option.attached.enabled {
    font-family: Montserrat;
    font-weight: 700;
}

https://jsfiddle.net/39gd2mtq/

What you currently have (option.attached enabled) is looking for a child element called enabled within option.attached.

Upvotes: 3

Related Questions