VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: gringo211985 on September 03, 2015, 13:55:38 PM

Title: Display Number Dropdown Selector CSS Styling???
Post by: gringo211985 on September 03, 2015, 13:55:38 PM
Hi there,

I want to style the drop down for the "display by number" box in the category pages, I have tried scouring with inspect element and firebug, I've looked through the forums and I have even looked at 3rd party templates and none of which have styled this part.

Can someone please give me an example of how to style the "display by number drop down"?

I have a white n red site and having that single drop down in blue will really hinder the design of the website.

Thanks,
Richard
Title: Re: Display Number Dropdown Selector CSS Styling???
Post by: GJC Web Design on September 03, 2015, 15:03:51 PM
very browser dependent but stuff like this can work - btw the style comes from the browser

IMHO only a grad or image will work for :checked

.orderby-displaynumber .inputbox > option:checked {
  background: rgba(0, 0, 0, 0) linear-gradient(#5a2569, #5a2569) repeat scroll 0 0;
}

.inputbox > option:hover, .inputbox > option:active, .inputbox > option:focus {
  background:red;
}
Title: Re: Display Number Dropdown Selector CSS Styling???
Post by: gringo211985 on September 03, 2015, 16:41:09 PM
Hi GJC,

Thanks for the quick reply, I've tried and it seems the browser is still overriding it for me. It's quite annoying with it being the only blue part of the website, would it be possible to change from <option> to another class which would make it easier to style?

Thanks,
Richard
Title: Re: Display Number Dropdown Selector CSS Styling???
Post by: Spiros Petrakis on September 03, 2015, 19:33:11 PM
As far as  i know there in no CSS only cross browser solution to style option elements , you will need js to create a different layout that is possible to be styled exactly as you like , check the following link for example
http://www.jankoatwarpspeed.com/reinventing-a-drop-down-with-css-and-jquery/ 
Title: Re: Display Number Dropdown Selector CSS Styling???
Post by: jenkinhill on September 03, 2015, 19:49:00 PM
Not tried, but would a "sledgehammer" approah like    select  { color: #5aa656; }  work?