It is not in all browsers. Different heights is one of the features of styling a particular browser.
In select for select have the same height, you need to remove the arrow on the right from it. But here is a nuance: if we add an arrow to the text field, it will not change its height. so it’s not 100% true that this is because of the arrow, but this is one of the solutions.
For this case, you can apply 3 solutions:
Option 1:
Adding a background image instead of a standard arrow
* { box-sizing: border-box; } select, input[type="text"] { width: auto; padding: 2px; border: 1px solid #ccc; font-size: 13px; -webkit-appearance: none; } select { padding-right: 10px; background-image: url(http://s1.iconbird.com/ico/2013/8/426/w32h321377581133134TriangleDown.png); background-size: 16%; background-repeat: no-repeat; background-position-y: center; background-position-x: calc(100% - 5px); }
<select> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> <input type="text" />
Option 2:
select'а frame in div and add pseudo- select'а :after
Based on the answer from eng stackoverflow : css-change-dropdown-arrow-to-unicode-triangle
* { box-sizing: border-box; } select, input[type="text"] { padding: 2px; border: 1px solid #ccc; font-size: 13px; -webkit-appearance: none; } select {padding-right: 10px;} .select {display: inline-block; position: relative;} .select:after { display: block; position: absolute; right: 5px; content: 'â–Ľ'; font-size: 0.6rem; top: 50%; pointer-events: none; transform: translateY(-50%); }
<div class="select"> <select> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> </div> <input type="text" value="Test" />
Option 3:
This option is similar to Option 2 , but here we are instead :after using svg
* { box-sizing: border-box; } select, input[type="text"] { padding: 2px; border: 1px solid #ccc; font-size: 13px; -webkit-appearance: none; } select {padding-right: 10px;} .select {display: inline-block; position: relative;} .select svg { display: block; position: absolute; right: 5px; width:20px;height:20px; font-size: 0.6rem; top: 50%; pointer-events: none; transform: translateY(-50%); }
<div class="select"> <select> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> <svg width="15" height="15" viewBox="0 0 15 15"> <path d="M 8,5.5 11,9.5 14,5.5 z"></path> </svg> </div> <input type="text" value="Test" />
These methods will also solve the problem that select rendered differently in different browsers and operating systems.