Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to Style Select DropDown in WordPress?

Featured Replies

Hi,

I want to custom style Select Drop Down box in WORDPRESS.

 

So the code will be

<select>

<option></option>

<option></option>

</select>

 

I dont want to add any class or id in <select> as this whole piece of code will be generated by WP.

 

So any tutorial or HTML/CSS/Jquery method to do it.

 

Thank you :)

  • Author

Hello,

I am so glad that I am able to attract an experts attention to my post :)

 

No, I don't want that.

 

Here is the code in my WP site source code:

 

<div id="archives-2" class="widget_archive"><h3>Archives</h3>
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
<option value="">Select Month</option>
<option value=''>September 2013</option>
<option value=''> May 2011</option>
</select>
</div>
 

 

Thank you

 

 

Edit:

OK Teodora, well can it be done if the <select> is inside an class. Because in the code, the <select> is inside widget_archive class.

 

Thank you

Edited by dsouravs

Here is how it works. If you use the parent container id, like this:

#archives-2 select{
       background:red; /*just for example*/
}

you can style the <select> only within this particular container #archives-2.

 

If you use the parent container class:

.widget_archive select{
       background:red; /*just for example*/
}

all select elements within a container that has a class widget_archive will be styled.

 

Hope that makes sense :)

  • Author

Thanks for your help but what I wanted was to make my <select> look like this image

http://pixelsdaily.designshack.netdna-cdn.com/wp-content/uploads/2011/04/dropdown.png

 

with the help of most easiest method of CSS3 and Jquery.

 

My WP codes look like

 

 

<div id="archives-2" class="widget_archive"><h3>Archives</h3>
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
<option value="">Select Month</option>
<option value=''>September 2013</option>
<option value=''> May 2011</option>
</select>
</div>
 

and my CSS look like

 

 

.widget_archive {}
.widget_archive ul {}
.widget_archive ul li {}
.widget_archive ul li a {}
.widget_archive select {}
.widget_archive option {}
 

But I didnt found a single code package that writes easy CSS.

 

Thank you :)

TC

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.