Problem: Custom Select Dropdown Control
Problem description
Given an HTML page containing a div with class custom-select-wrapper that wraps a <select class="custom-select"> element with several <option>s, write CSS to:
Remove the native dropdown arrow using
appearance: none(cross-browser).Style
.custom-selectas follows:Width should be
200px, height should be40px.Padding should be
0 1rem.Border should be
1px solid #ccc,border-radiusshould be4px.Background color should be
#fff.Transition should be
border-color 0.2s ease.
Use the
::afterpseudo-element on.custom-select-wrapperto display a downward arrow ("▼") positioned at the right (1remfrom edge), vertically centered, non-interactive (pointer-events: none), withfont-size0.6remandcolor#666.Change the
.custom-selectborder-colorto#0066cconhoverand onfocus, and remove the defaultfocusoutline.
Goal
Write CSS rules so that the dropdown appears as a clean white box with a custom arrow; its border smoothly highlights in blue on hover/focus.
Constraints
Use only CSS (no JavaScript).
Target cross-browser appearance removal with
appearance: none,-webkit-appearance: none, and-moz-appearance: none.Arrow pseudo-element should be content
"▼", font-size should be0.6rem, positioned viaabsolutepositioning in the wrapper.Transition should apply only to
border-color, duration should be0.2s, and useeasetiming.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.
Problem: Custom Select Dropdown Control
Problem description
Given an HTML page containing a div with class custom-select-wrapper that wraps a <select class="custom-select"> element with several <option>s, write CSS to:
Remove the native dropdown arrow using
appearance: none(cross-browser).Style
.custom-selectas follows:Width should be
200px, height should be40px.Padding should be
0 1rem.Border should be
1px solid #ccc,border-radiusshould be4px.Background color should be
#fff.Transition should be
border-color 0.2s ease.
Use the
::afterpseudo-element on.custom-select-wrapperto display a downward arrow ("▼") positioned at the right (1remfrom edge), vertically centered, non-interactive (pointer-events: none), withfont-size0.6remandcolor#666.Change the
.custom-selectborder-colorto#0066cconhoverand onfocus, and remove the defaultfocusoutline.
Goal
Write CSS rules so that the dropdown appears as a clean white box with a custom arrow; its border smoothly highlights in blue on hover/focus.
Constraints
Use only CSS (no JavaScript).
Target cross-browser appearance removal with
appearance: none,-webkit-appearance: none, and-moz-appearance: none.Arrow pseudo-element should be content
"▼", font-size should be0.6rem, positioned viaabsolutepositioning in the wrapper.Transition should apply only to
border-color, duration should be0.2s, and useeasetiming.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.