<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>gudai.cnblogs.com</title>
<style type="text/css">
<!--
*{PADDING: 0px; margin: 0px;}
.verticalMiddleClassDiv {
width:500px;
height:30px;
line-height:30px;
border:1px solid #ccc;
overflow:hidden;
position:relative;
text-align: left;
PADDING-LEFT: 10px;
}
/*这是关键的css*/
.verticalMiddleClassP {
position:static;
+position:absolute;
top:30%;
}
.verticalMiddleClass{
position:static;
}
-->
</style>
</head>
<body>
<div class="verticalMiddleClassDiv">
<p class="verticalMiddleClassP"><img src="http://www.duote.com/img/green.gif" class="verticalMiddleClass">
<span class="verticalMiddleClass">速度飞快</span>
</p>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>gudai.cnblogs.com</title>
<style type="text/css">
<!--
*{PADDING: 0px; margin: 0px;}
.verticalMiddleClassDiv {
width:500px;
height:30px;
line-height:30px;
border:1px solid #ccc;
overflow:hidden;
position:relative;
text-align: left;
PADDING-LEFT: 10px;
}
/*这是关键的css*/
.verticalMiddleClassP {
position:static;
+position:absolute;
top:30%;
}
.verticalMiddleClass{
position:static;
}
-->
</style>
</head>
<body>
<div class="verticalMiddleClassDiv">
<p class="verticalMiddleClassP"><img src="http://www.duote.com/img/green.gif" class="verticalMiddleClass">
<span class="verticalMiddleClass">速度飞快</span>
</p>
</div>
</body>
</html>