61,115
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<script src="jquery-1.10.2.min.js"></script>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="300px">A</td>
<td id="ttttt">B
<div class="jueduidingwei">cc</div>
</td>
</tr>
</table>
<style>
html,body{height:100%;border:0;padding:0;margin:0}
#ttttt{background:green;padding:0;margin:0}
.jueduidingwei
{
position:absolute;background:red;
}
</style>
<script>
$(function(){
$(".jueduidingwei").css("top",$("#ttttt").get(0).offsetHeight - $(".jueduidingwei").height() + "px")
$(".jueduidingwei").css("width",$("#ttttt").get(0).offsetWidth + "px")
$(".jueduidingwei").css("left",$("#ttttt").prev().get(0).offsetWidth + "px")
});
</script>