答案:运行代码框<!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=gb2312" /><title>无标题文档</title><style type="text/css"><!--* {margin: 0; padding:0}body {margin-top: 10px;margin-right: auto;margin-bottom: 10px;margin-left: auto;text-align: center;height: auto;width: auto;background-color: #666666;font-size: 12px;color: #000000;}#container {text-align: left;width: 760px;height: 400px;background-color: #FFFFFF;padding: 20px;}#container #title {height: 31px;background-color: #3A81C8;}#container #title li {float: left;list-style-type: none;height: 28px;line-height: 28px;text-align: center;margin-right: 1px;}#container #title ul {background-color: #FFFFFF;height: 28px;}#container #title a {text-decoration: none;color: #000000;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -29px;}#container #title a span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-repeat: no-repeat;background-position: right -29px;padding-right: 15px;padding-left: 15px;}#container #title a:hover {text-decoration: none;color: #000000;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -87px;}#container #title a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -87px;padding-right: 15px;padding-left: 15px;}#container #title #download a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left 0px;}#container #title #download a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right 0px;padding-right: 15px;padding-left: 15px;}#container #title #product a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -58px;}#container #title #product a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -58px;padding-right: 15px;padding-left: 15px;}#container #title #login a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -145px;}#container #title #login a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -145px;padding-right: 15px;padding-left: 15px;}#container #title #contactus a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -174px;}#container #title #contactus a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -174px;padding-right: 15px;padding-left: 15px;}#container #title #homepage .selectli {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -87px;}#container #title #homepage a .selectspan {display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -87px;padding-right: 15px;padding-left: 15px;}#container #content {border: 1px solid #3A81C8;height: 200px;padding: 10px;}#container #content ul {margin: 10px;}#container #content li {margin: 5px;}--></style></head><body><div id="container"> <div id="title"> <ul> <li id="homepage"><a href=> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
运行代码框<!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=gb2312" /><title>无标题文档</title><style type="text/css"><!--* {margin: 0; padding:0}body {margin-top: 10px;margin-right: auto;margin-bottom: 10px;margin-left: auto;text-align: center;height: auto;width: auto;background-color: #666666;font-size: 12px;color: #000000;}#container {text-align: left;width: 760px;height: 400px;background-color: #FFFFFF;padding: 20px;}#container #title {height: 31px;background-color: #3A81C8;}#container #title li {float: left;list-style-type: none;height: 28px;line-height: 28px;text-align: center;margin-right: 1px;}#container #title ul {background-color: #FFFFFF;height: 28px;}#container #title a {text-decoration: none;color: #000000;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -29px;}#container #title a span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-repeat: no-repeat;background-position: right -29px;padding-right: 15px;padding-left: 15px;}#container #title a:hover {text-decoration: none;color: #000000;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -87px;}#container #title a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -87px;padding-right: 15px;padding-left: 15px;}#container #title #download a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left 0px;}#container #title #download a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right 0px;padding-right: 15px;padding-left: 15px;}#container #title #product a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -58px;}#container #title #product a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -58px;padding-right: 15px;padding-left: 15px;}#container #title #login a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -145px;}#container #title #login a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -145px;padding-right: 15px;padding-left: 15px;}#container #title #contactus a:hover {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -174px;}#container #title #contactus a:hover span{display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -174px;padding-right: 15px;padding-left: 15px;}#container #title #homepage .selectli {text-decoration: none;color: #ffffff;display: block;width: auto;background-image: url(/upload/2007/12/27/2007122702719748.gif);background-repeat: no-repeat;background-position: left -87px;}#container #title #homepage a .selectspan {display: block;background-image: url(/upload/2007/12/27/2007122702719992.gif);background-position: right -87px;padding-right: 15px;padding-left: 15px;}#container #content {border: 1px solid #3A81C8;height: 200px;padding: 10px;}#container #content ul {margin: 10px;}#container #content li {margin: 5px;}--></style></head><body><div id="container"> <div id="title"> <ul> <li id="homepage"><a href=> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
上一个:关于上中下三栏自适应100%高度。下一个:Div+CSS+JS树型菜单,可刷新