我想做这个:
这是我到目前为止的 HTML/CSS,但是在尝试了浮动、绝对/相对位置、左边、左边距、清除、溢出等的各种组合之后。我无法让它处理不同的长度。
<!DOCTYPE html>
<html>
<head>
<style>
.container {
}
.leftColumn {
float:left;
}
.rightColumn {
float:left;
left:120px;
position:absolute;
}
.clear {
clear:both;
}
</style>
</head>
<body>
<div class="container">
<div class="leftColumn">Apr 14: Title: </div>
<div class="rightColumn">This is a text that will have a variable width, sometimes short and sometimes very, very long, sometimes short and sometimes very, very long.</div>
<div class="clear"></div>
</div>
<div class="container">
<div class="leftColumn">Apr 15: Another Title: </div>
<div class="rightColumn">This is a text that will have a variable width, sometimes short and sometimes very, very long, sometimes short and sometimes very, very long.</div>
<div class="clear"></div>
</div>
<div class="container">
<div class="leftColumn">Apr 16: A Still Longer Title: </div>
<div class="rightColumn">This is a text that will have a variable width, sometimes short and sometimes very, very long, sometimes short and sometimes very, very long.</div>
<div class="clear"></div>
</div>
</body>
</html>
我必须对上面的 CSS 进行什么更改,以便它处理两列中的可变长度文本,如上面的屏幕截图所示?