PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 8, 2022

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

 January 08, 2022     css, frontend, html, woocommerce, wordpress     No comments   

Issue

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


Solution

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.



Answered By - MeltingDog
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing