CSS+DIV实现更换背景效果

来源:百度知道 编辑:UC知道 时间:2024/06/07 01:32:13
具体效果是
我在左边建立了个竖状菜单,如边放个DIV容器
我想点击左边菜单相应安钮时,更换DIV容器的背景
具体代码应该怎样写

是否要加入JS??

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<style type="text/css">
*{margin:0;padding:0;}
body{font-size:12px;}
#tab_menu{float:left;width:100px;}
#tab_menu li{width:100px;height:30px;line-height:30px;text-align:center}
#tab_content{float:left;margin-left:10px;}
#tab_content div{display:none;}
#tab_content div.block{display:block}
</style>
<script type="text/javascript">
function se