1
我一直在探索这个小时无济于事。我基本上将我的网站从过时的表格设置转换为div设置。更改父DIV在儿童的身高变化
这里是什么样的事情,我曾在一个表中建立的样本: http://jsfiddle.net/vxgqE/2/
这是它与一个div设置: http://jsfiddle.net/G3bNh/
我已经成功地对齐DIV正确使用float:left和position:relative属性,但是我发现的问题是,当右侧单元格(见上面的链接)高度增长时,左侧单元格会增长 - 这种情况在类似情况下不会发生一个div设置。
我怎样才能确保这两个中间细胞总是保持相同的高度?
我知道有大量JavaScript和jQuery解决方案在那里......但是有没有任何纯粹的HTML/CSS解决方案?
感谢您的意见,我们非常感谢。
HTML代码:
<table>
<tr>
<td class="top">
<!-- image1 !-->
</td>
</tr>
<tr>
<td class="mid1">
<p>
exrc fdbodf nosdf ifd onsdfo nj dfnsn a fnl mfasn saf
</p>
</td>
<td class="mid2">
<p>
exrc fdbodf nosdf ifd onsdfo nj dfnsn a fnl mfasn saf
</p>
</td>
</tr>
<tr>
<td class="bot">
<!-- image2 !-->
</td>
</tr>
</table>
股利代码:
<html>
<head>
<style type="text/css">
div {border: 1px solid;}
#arrowItem {
position: absolute;
float: left;
width: 100%;
}
#arrowItem-ArrowTop {
background-image: url('img/About-Process_ArrowsTop.png');
height: 70px;
width: 300px;
}
#arrowItem-ArrowCenter {
position: absolute;
}
#arrowItem-ArrowBot {
background-image: url('img/About-Process_ArrowsBot.png');
height: 70px;
width: 300px;
}
#arrowItem-RightText {
position: absolute;
float: left;
position: relative;
width: 600px;
}
#arrowItem-text1 {
position: relative;
float: left;
width: 300px;
background-color: #d4e0a9;
border-right: 2px solid #a0b165;
border-left: 2px solid #a0b165;
}
#arrowItem-text2 {
position: relative;
float: left;
width: 300px;
}
</style>
</head>
<body>
<div id="arrowItem">
<div id="arrowItem-ArrowTop">
</div>
<div id="arrowItem-ArrowCenter">
<div id="arrowItem-text1">
<p>
1234567812345678
</p>
</div>
<div id="arrowItem-text2">
<p>
23456723456789
</p>
</div>
</div>
<div id="arrowItem-ArrowBot">
</div>
</div>
您的非表代码在哪里?这就是我们需要处理的东西:) –
我在那里为你添加了一个链接:http://jsfiddle.net/G3bNh/ – kirgy