1
A
回答
2
不要以爲這需要任何特殊技能。這是一個非常基本的流體佈局。一個例子
標記
<div id="wrapper">
<input type="text" id="firstrow_textbox" />
<input type="text" id="secondrow_textbox" />
<input type="button" id="secondrow_button" />
</div>
CSS
#wrapper {
width: 70%;
}
#firstrow_textbox { width: 100%; }
#secondrow_textbox { width: 70%; }
#secondrow_button { width: 28%; } /* Due to border and all */
1
您可以通過創建一個具有所需「屏幕寬度70%」的包裝元素,然後調整輸入大小來獲得此功能。
你還是要調整邊距和補爲您的特定目的,但是這應該是一個不錯的開始。
0
事情是這樣的 - >http://jsfiddle.net/Husar/gkFhb/2/
只是微調邊距和填充
0
佈局:
<div class="container">
<div>
<input type="text" id="input1" /></div>
<div>
<input type="text" id="input2" />
<input type="button" id="input3" /></div>
</div>
CSS:
.container {
margin: auto; /* to center the container horizontally */
width: 70% /* to take the 70% of the parent element */
}
#input1 {
width: 100%; /* to take the 100% of the parent which is the container div */
}
#input2 {
float: left; /* to align the control on the left */
width:70%; /* to take the 70% of the parent which is the container div */
}
#input3 {
float: right; /* to align the control to the right */
width:29%; /* to take the 29% of the parent which is the container div */
}
相關問題
- 1. CSS佈局的關注
- 2. 使用HTML和CSS佈局內容
- 3. 如何使用CSS製作此頁眉/內容/頁腳佈局?
- 4. 如何使用片段佈局填充我的內容佈局
- 5. 如何使CSS佈局適合html內容?
- 6. 佈局內容從粘腳註失算
- 7. Css框佈局主要內容在100%
- 8. CSS佈局和內容滾動
- 9. CSS網頁佈局適應於內容
- 10. CSS佈局,頁腳是中間內容
- 11. 基於CSS內容的佈局
- 12. 帶CSS的水平內容佈局
- 13. 線性佈局如何獲得關注?
- 14. 如何關注佈局本身?
- 15. CSS內容/側邊欄關注背景
- 16. 使用css和html創建內容網格佈局困難
- 17. 如何在添加內容時保持CSS佈局(ASP.NET)
- 18. 使用DojoX佈局,是否可以替換佈局的內容?
- 19. 如何使用CSS div佈局模仿colspan = 2佈局表格
- 20. 如何更改佈局的內容?
- 21. 如何清除佈局上的內容?
- 22. 如何更改佈局的內容?
- 23. 如何在ADT/GraphicalLayout中使用動態內容設計佈局?
- 24. 如何使用自動佈局設置scrollview內容大小?
- 25. 如何使用佈局內容加載模態對話框?
- 26. 使用關鍵幀CSS更改內容
- 27. 如何在框架佈局內使用相對佈局
- 28. 幫助使用CSS佈局
- 29. Joomla內容博客佈局
- 30. 改變佈局/內容
你不能。您製作一個包含輸入字段+按鈕的DIV,並使DIV 70%的屏幕。那麼輸入將是DIV的100%,第二個輸入將是DIV的70%,並且該按鈕將是DIV的最後30%。 – diceler 2011-04-29 12:55:30