无缝滚动制作
代码中没有写到,当鼠标经过字的颜色变红色啊?
代码中没有写到,当鼠标经过字的颜色变红色啊?
2016-03-21
<!DOCTYPE html>
<html>
<body>
<div onmouseover="mOver(this)" onmouseout="mOut(this)" style="width:120px;height:20px;padding:40px;">把鼠标移到上面</div>
<script>
function mOver(obj)
{
obj.style.color="red";
}
function mOut(obj)
{
obj.style.color="black";
}
</script>
</body>
</html><!DOCTYPE html>
<html>
<body>
<div style="width:120px;height:20px;padding:40px;">把鼠标移到上面</div>
<style>
div:hover{
color:red;
}
</style>
</body>
</html>HTML onmouseover 事件属性 http://www.w3school.com.cn/tags/event_onmouseover.asp
CSS :hover 选择器 http://www.w3school.com.cn/cssref/selector_hover.asp
举报