Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
提到的两个块确实具有相同的宽度。它只是让你在你的父 div(.select) 中有填充,并且在“选择”上没有边框,这使得它“看起来”更大了。
除了您拥有的其他 CSS 之外,为了确保选择及其选项的宽度相同,您应该在以下行中添加一些内容:
select, select option { width: 200px; /* change as needed */ }