解决方案1:
很容易解决这个问题table
,就这样使用
<table width="100%">
<tr>
<td background="your/image/url5">content...</td>
<td width="950" background="your/image/url">content goes here...</td>
<td background="your/image/url5">content...</td>
</tr>
</table>
您可以使用所有三个块来编写内容,也可以使用不同的内容
解决方案2:
如果你需要 with div
,那么你需要为此编写一点 jQuery
html:
<div class="left"></div>
<div class="center">content goes here...</div>
<div class="right"></div>
CSS:
<style>
.left{
background:url(your/image);
float:left;
}
.center{
background:url(your/image);
float:left;
width:950px;
}
.right{
background:url(your/image);
float:left;
}
</style>
jQuery :
<script type="text/javascript">
var window_width = $(window).width(); // get window width
var total_remain = $(window).width()-950; // (-) your center div width
var apply_width = total_remain / 2; // get remaining and divide by 2
$(".left").css("width","apply_width"); // appying the width to the right / left
$(".right").css("width","apply_width"); // appying the width to the right / left
</script>