.box,li { padding:0; margin:0; list-style:none; } .box { display:flex; width:600px; height:200px; flex-wrap:wrap; border:1px solid yellow; } li { display:flex; justify-content:center; align-items:center; width:200px; height:100px; background:pink; } .active { border:2px solid red; box-sizing:border-box; }
控制键盘上下左右会移动焦点选择模块。