日期:2014-05-17 浏览次数:21291 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<style>
.userinfo_sp {
height: 22px;
width: auto;
background:url(images/ico_tip.gif) left center no-repeat;
padding-left:20px;
}
</style>
</head>
<body>
<div class="show_u_li_right">
<span><input type="text" class="userinfo_input"/></span>
<span class="userinfo_sp">输入旧密码</span>
</div>
</body>
</html>
------解决方案--------------------
<span class="userinfo_sp"><img src="img/form (1).gif"/>输入旧密码</span>
调整为:(由于span是行内元素,img是段元素,这样写不符合规范!!)
<img id="pic" src="img/form (1).gif"/>
<span id="text" class="userinfo_sp">输入旧密码</span>
<script>
document.getElementById("text").style.position="absolute";
document.getElementById("text").style.top=document.getElementById("text").style.top+document.getElementById("text").height/2+"px";
</script>
------解决方案--------------------