Occasionally, I need to group select contents. In the past, I used program control. Today, I found that there is an optgroup attribute in select that can be used. It has been tested and is suitable for browsers such as Firefox and IE. The only shortcoming found so far is that the title style after the group cannot be customized. For example: if you want to change the font properties, you can't use the normal font, but you can change the color and size. In IE, the default is italic and bold ![]() Copy code The code is as follows:<select name="bid" id="brand_3"> <option value="">Please select a brand</option> <optgroup label="A"></optgroup> <option value="693" custom="693">A AC BMW</option> <option value="62" custom="62">A Aston Martin</option> <option value="1" custom="1">A Audi</option> <optgroup label="B"></optgroup> <option value="723" custom="723">B Babos</option> <option value="44" custom="44">B Porsche</option> <option value="582" custom="582">B Baojun</option> <option value="20" custom="20">B BMW</option> <option value="593" custom="593">B Beijing Auto</option> <option value="643" custom="643">B BAIC Weiwang</option> <option value="122" custom="122">B BAIC Manufacturing</option> <option value="4" custom="4">B Mercedes-Benz</option> </select> |
<<: Vue+openlayer5 method to get the coordinates of the current mouse slide
>>: CSS achieves the effect of changing the color of the entire line when the mouse is placed on it
I will not introduce what CUDA is, but will direc...
Table of contents 1. Database Overview 1.1 Develo...
Using CSS layout to create web pages that comply w...
Table of contents Vue CLI builds a Vue project Vu...
This article briefly introduces the relationship ...
Nginx supports three ways to configure virtual ho...
Docker Installation curl -fsSL https://get.docker...
1. The ul tag has a padding value by default in M...
background go-fastdfs is a distributed file syste...
Some friends, when learning about databases, acci...
The effect is very simple, just copy the following...
Preface: When using MySQL, you may encounter time...
MySQL group sorting to find the top N Table Struc...
In the previous article, I introduced the detaile...
Table of contents 1. The writing order of a compl...