自适应标题方案
<!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>
</head>
<body>
<style>
ul {list-style: none;margin: 0px;padding: 0px;}
.bg1,.title li.left,.title li.mid,.title li.right{background:url(bg_z.gif) repeat-x;}
.bg1{width:100%; height:28px;border:1px #000 solid;background-position:0px -60px;}
.title{margin:0px;padding:0px;font-size:12px;position:absolute;z-index:2}
.title li{float:left;height:28px;}
.title li.left{width:25px;background-position:0px 0px;}
.title li.mid{padding-top:12px;background-position:0px -120px;height:28px;}
.title li.right{width:25px;background-position:0px -90px;}
</style>
<div class="bg1">
<div class="title">
<ul>
<li class="left"></li>
<li class="mid">我是标题!我是标题!</li>
<li class="right"></li>
</ul>
</div>
</div>
</body>
</html>
下面是我的背景图:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>自适应标题方案</title>
</head>
<body>
<style>
ul {list-style: none;margin: 0px;padding: 0px;}
.bg1,.title li.left,.title li.mid,.title li.right{background:url(bg_z.gif) repeat-x;}
.bg1{width:100%; height:28px;border:1px #000 solid;background-position:0px -60px;}
.title{margin:0px;padding:0px;font-size:12px;position:absolute;z-index:2}
.title li{float:left;height:28px;}
.title li.left{width:25px;background-position:0px 0px;}
.title li.mid{padding-top:12px;background-position:0px -120px;height:28px;}
.title li.right{width:25px;background-position:0px -90px;}
</style>
<div class="bg1">
<div class="title">
<ul>
<li class="left"></li>
<li class="mid">我是标题!我是标题!</li>
<li class="right"></li>
</ul>
</div>
</div>
</body>
</html>
下面是我的背景图:
![](https://www.cnblogs.com/images/cnblogs_com/jcdmt/bg_z.gif)