Precautions:
1, positioning left weight higher than right, top weight higher than bottom
2, two span tags nested in a box, in the future show hidden just need to control the parent box on the line
<!DOCTYPE HTML><HTML><HeadLang= "en"> <MetaCharSet= "UTF-8"> <title></title> <style>. Box{width:400px;Height:300px;Border:1px solid #ccc;margin:150px Auto;position:relative; }. Arrow{Display:None; }span{position:Absolute;Top:50%;Margin-top:-40px;width:30px;Height:80px;text-align:Center;Line-height:80px;font-size:40px;background:Rgba (255, 198, 0.3); }. Left{ Left:0px;Border-radius:0 10px 10px 0; }. Right{ Right:0px;Border-radius:10px 0 0 10px; } </style></Head><Body><Divclass= "box"> <Divclass= "Arrow"> <spanclass= "Left"><</span> <spanclass= "Right">></span> </Div></Div><Script> varDivele=document.getElementsByTagName ("Div")[0]; varArrele=document.getElementsByTagName ("Div")[1]; Divele.onmouseover= function() {ArrEle.style.display= "Block"; } divele.onmouseout= function() {ArrEle.style.display= "None"; }</Script></Body></HTML>
css--arrows in a carousel diagram