.nav { position:relative } .tabs { list-style:none; padding:0 } .tabs a { text-decoration:none; color:#000; width:150px; height:40px; line-height:40px; text-align:center; display:inline-block; } .tabs>li { float:left; border-bottom:1px solid #000; } .box { width:150px; height:39px; border:1px solid #000; border-bottom:1px solid #fff; position:absolute; top:0; left:0; transition:all .5s linear; }