.my_sort{ width:90%; max-width:220px; position:relative; z-index:3; } .my_head{ display:flex; justify-content:space-between; align-items:flex-end; background:var(--color); color:#fff; font-size:24px; padding:20px 0 20px 40px; } .sort_box{ display:block; overflow: auto; padding-top:15px; } .sort_name{ padding:10px 0 10px 40px; font-size:15px; line-height:30px; color:#333; overflow:hidden; text-overflow:ellipsis; display:block; white-space:nowrap; background:#f3f3f3; border-bottom:1px #dededf solid; transition:all 0.35s ease; } .sort_list:last-child{ margin-right:0; } .sort_name:hover{ background:var(--color); color:#fff; } .sort_name.sort_click{ background:var(--color); color:#fff; } @media(max-width:768px){ .my_sort{ width:100%; max-width:100%; margin-bottom:30px; } .my_head{ margin-top:20px; font-size:17px; padding:12px 30px; } .btn_text{ font-size:12px; padding-left:20px; } .btn_text:before{ content:'鐐瑰嚮灞曞紑'; } .my_head.active .btn_text:before{ content:'鐐瑰嚮鏀惰捣'; } .sort_box{ position:absolute; width:100%; padding:0; max-height:0; overflow:hidden; transition:all 0.5s ease; } .sort_box.active{ max-height:400px; } .sort_name{ font-size:14px; line-height:20px; padding:12px 0 12px 30px; } }