我一直在網絡和Xpages編程中遇到這種困難。正確的方法有兩列,一個浮動左邊和一個浮動右邊
我想要一個響應的容器和一個兩列的表。在左欄中,我希望我的標籤或字段左對齊並右對齊。
我相信我不應該使用表格,但divs。
我已經試過代碼如下:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title>test</title>
<style type="text/css">
.container {
width: auto;
}
.left {
float:left;
}
.right {
float:right;
}
.line {
display:inline;
}
</style>
</head>
<div class = "container">
<div class = "line"><p class="left">Label 1</p><p class = "right">Value 1</div>
<div class = "line">Label 2</div>
<div>
</body>
</html>
任何幫助將不勝感激!
請記住Internet Explorer兼容模式(可強制爲內部站點使用)忽略浮動。 –