我正在嘗試使固定標題在水平方向上分爲3個部分。中間部分寬度爲1000px,其他2部分與自動寬度相同。此外,左側部分具有粘合到中央部分的邊緣的圖像。我已經嘗試了幾個解決方案,但是我僅通過使用表來完成此任務。誰能幫我這個?HTML 3列標題
1
A
回答
1
你可以使用div來顯示錶格單元格。
HTML:
<div class="header">
<div class="l">l</div>
<div class="m">m</div>
<div class="r">r</div>
</div>
CSS:
.header {
display: table;
width: 100%;
table-layout: fixed;
}
.header > div {
display: table-cell;
}
.l {
background: lightblue;
}
.m {
background: lightgreen;
width: 500px;
}
.r {
background: lightblue;
}
還要檢查the demo。
-1
你可以用表格或div來做,但是,爲了靈活性和一致性,我建議你在div上做。
表:
<table width="1200" height="100">
<tbody>
<tr>
<td></td>
<td width="1000"></td>
<td></td>
</tr>
</tbody>
</table>
事業部:
去這裏,中心DIV是最大的一個,側格是別人,不要取下透明DIV,它是隻有一個浮點修復的HTML。只需相應地將CSS更改爲你想要的。
1
我會限制使用表的表格數據。根據您的描述,我認爲這將適用於您。你正在做的是將一個固定的寬度設置到中間列,並將結束列的寬度設置爲50%,然後在中央列的每半寬度上設置負邊距。 CSS可能會更有效一些。
HTML
<div class="wrapper">
<div class="left">Add Image here</div>
<div class="center"> </div>
<div class="right"> </div>
</div>
CSS
.wrapper {
overflow: hidden;
}
.center {
float: left;
width: 1000px;
background: red;
}
.right {
float: right;
width: 50%;
background: green;
margin-right: -500px;
}
.left {
float: left;
width: 50%;
background: blue;
margin-left: -500px;
text-align: right;
}
相關問題
- 1. 如何在ASP.NET MVC 3中添加Html WebGrid列名(標題)
- 2. 文本標題塊浮動權在3列布局標題
- 3. 創建一個3列的wordpress標題
- 4. Jommla 3標題標題欄
- 5. Bootstrap 3柵格列jumbotron標題
- 6. html 3列布局
- 7. HTML表單3列
- 8. Rails 3頁面標題
- 9. 標題在HTML
- 10. 固定第一列和標題HTML表
- 11. HTML標題下拉列表中
- 12. PHP的HTML表支點列標題
- 13. MVC 3 - img alt HTML標記?
- 14. 獨立滾動3列與單獨的列標題
- 15. Rails 3標記問題,acts_as_taggable_on
- 16. bootstrap 3 jumbotron bs標題下
- 17. 標題標籤html編輯
- 18. ExtJS 3 - 總是在GridPanel列標題中顯示菜單圖標?
- 19. 3列布局問題
- 20. 解析HTML標題
- 21. Office HTML Word標題
- 22. 更改標題html
- 23. html標題編碼
- 24. HTML郵件標題
- 25. 無邊html標題
- 26. Amazon S3 HTML標題
- 27. html標題與ios
- 28. HTML標記問題
- 29. HTML標題圖片
- 30. CSS 3列布局問題
[顯示方式](http://jsfiddle.net)你有什麼到目前爲止已經試過! – edsioufi