我希望当我将鼠标移到 svg 上时,文本会向右移动,使其可见;但是它不起作用。会有什么问题?
HTML:
<div class="exitBox">
<span class="exitButton"><?php include "SVGs/sair.svg"; ?></span>
<span class="exit"><a href="#" id="exitA">SAIR</a></span>
</div>
CSS:
.exitBox{
display: inline;
position: fixed;
top: 20px;
left: 40px;
overflow: hidden;
}
.exitButton svg{
width: 20px;
color: black;
}
#exitA{
display: inline-block;
text-decoration: none;
color: black;
font-size: 30px;
letter-spacing: 2px;
font-family: Teko;
transform: translateX(-100px);
}
脚本脚本:
var exit = document.getElementById("exitA");
var exitB = document.getElementsByClassName("exitButton");
exitB.onmouseover = function exit(){
exit.style.transform = "translateX(100px)";
}
米琪卡哇伊
相关分类