* { margin:0; padding:0; } ul { list-style:none; } a { text-decoration:none; } #box { width:1200px; display:flex; } #box li { width:500px; height:300px; flex:auto; transition:all .3s; } #box li:hover { flex-shrink:0; } #box li:hover a { display:none; } #box li a { display:block; width:100%; height:100%; color:#fff; background:rgba(0,0,0,.3); } #box li a span { display:block; margin:0 auto; padding-top:40px; width:24px; font-size:24px; }
用纯CSS只需要添加display:flex;flex-shrink:0;用JQuery会比较麻烦而且要考虑宽度问题