I'm a backend developer, learning frontend, new to CSS.
Working on a project, have to set a default CSS for select
tag. However on click over this tag border color is getting changed to blue from green and text color to black from green. Tried to find out CSS implementing on click however no use. All that is visible on inspect element is some event is active on select
. Tried to add my own event on click and change CSS back, however not able to achieve it so.
CSS:
.customSelect {
border-radius: 1.25rem;
height: calc(5.25rem + 2px);
font-size: 3rem;
color: #00a082;
border: 3px solid #cbece5;
}
Tried to add same class on custom click event, however something else is replacing my CSS.
JS:
$("#selectId").click( () => {
$("#selectId").addClass('customSelect');
});
How to add custom CSS on select
tag and also on its option
drop-down menu?
EDIT Why not a duplicate for how-to-style-the-option-of-a-html-select
My question is not to style option
tag, but to stop my select
box from changing border color to blue like when we click on select
or in input
tag and by default these changes to blue. Like comment, question title, question body and answer box all changes border color to blue when clicked. I don't want that to happen.