dreamweaver里的spry做下拉菜单时,鼠标经过时的背景蓝色怎么更改

2025-05-18 20:01:20
推荐回答(1个)
回答(1):

我们举例为鼠标移入test标签时变色(为显示效果添加一条黑色边框):





测试文档



我是测试


CSS伪元素的写法为

a:hover{background:blue;}

JQ写法为(效果与hover一样)

$(function(){
    $('.test').mouseover(function(){
        $(this).css({'background':'blue'});
    }).mouseout(function(){
        $(this).css({'background':''});
    });
});

JS写法不多加赘述,与JQ用法类似,同样是需要写一个移入移出事件

相关问答