0
A
回答
1
的領域添加.fieldwrapper{display:inline-block}
由於DIV是塊元素,它是下一行中得到顯示,從而使內聯塊然後它在同一行中流動。
演示here
在簡單的形式,你可以刪除DIV圍繞輸入,寫像下面
<div class="r6 dc3 ts2 p4">
<label field_id="None" for="sender">Sender email address</label>
<input class="field r2 lft dc1 tc5 ts3" placeholder="Email" type="text" value="">
</div>
.lft { float: left; }
ul, li { list-style-type: none; }
.ts3 { font-size: 15px; }
.dc3 { background-color: #808080; }
.tc5 { color: #333333; }
.p4 { padding: 4px; }
.r2 { border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; }
.r6 { border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; overflow:auto}
.field { line-height:27px; font-family:arial, sans-serif; border-color: #d9d9d9; border-top:solid 1px #c0c0c0; padding-left:5px; margin-right: 15px; width:250px; }
label{float:left; padding-right:15px}
1
你想圍繞標籤中的 「行」 的包裝和場。
然後您將標籤左側和右側的字段浮動。
要清除設置「行」花車以overflow: hidden;
.formRow {
background: #eee;
width: 90%;
padding: 5px 5% 5px 5%;
overflow: hidden;
}
.formRow label {
float: left;
}
.formRow .field{
float: right;
}
<div class="formRow">
<label field_id="None" for="sender">Sender email address</label>
<input class="field r2 lft dc1 tc5 ts3" placeholder="Email" type="text" value="">
</div>
這是一個非常簡單的例子。你可以在這裏玩弄寬度和高度 - http://jsfiddle.net/spacebeers/cskQ8/8/
0
給出的例子使用inline-block
。但是,您的圖像顯示文字是垂直居中的。你可以使用display: table-cell
。
0
嘗試此,可以是U需要編輯的大小,填充和顏色....
CSS =>
@charset "utf-8";
body{
margin:auto;/*for aligning*/
padding:0; /*for squeezing in txt*/
height:100%; /*100% used to fill windows height*/
behaviour:url(csshover.htc);
}
.header{
margin:auto;/*for aligning*/
padding:5px;
height:30px;
width:100%;
background-color:#808080;
}
.header .holder{
margin:auto;
padding:0;
height:30px;
width:1018px;
background-color:#333333;
}
.lft {
float: left;
}
ul, li {
list-style-type: none;
}
.tc5 {
color:black;
}
.r2 {
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
.field {
line-height:27px;
font-family:arial, sans-serif;
border-color: blue;
border-top:solid 1px #c0c0c0;
padding-left:5px;
margin-right: 15px;
width:250px;
}
HTML =>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="new.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="header">
<div class="holder">
<label field_id="None" for="sender"align="left">Sender email address</label>
<input class="field r2 lft tc5 " placeholder="Email" type="text" value="">
<div class="fieldwrapper">
</div>
</div>
</div>
</body>
</html>
相關問題
- 1. DRF:操作串行領域的佈局
- 2. 試圖在「圖形佈局」選項卡中查看我的XML
- 3. 如何佈局領域正確
- 4. 卡住試圖抽象的東西,我試圖過度簡化?
- 5. BackboneJS,MarionetteJS - 試圖顯示佈局+區域
- 6. 布爾領域
- 7. git-svn git擴展卡住身份驗證領域
- 8. 硒測試卡住
- 9. maven測試卡住
- 10. xamarin卡片視圖佈局
- 11. Hangfire卡住重試嘗試
- 12. JVM卡住試圖獲取信號量
- 13. 卡住試圖引導使用廚師
- 14. 卡住試圖列出相關模型
- 15. Gridview滾動卡住時試圖滾動
- 16. 卡住試圖訪問散列值
- 17. 卡住試圖在mssql中使用uiee
- 18. 顯示Mongoid局部領域
- 19. 卡住此佈局上媒體查詢的最佳方法
- 20. openshift eclipse發佈卡住
- 21. wpf卡布局
- 22. 試圖創建實例應用領域
- 23. 春試圖綁定所有領域
- 24. 試圖從另一個領域
- 25. 發佈類領域的另一個類領域
- 26. 我試圖從ansible ssh到Windows機器,程序卡住
- 27. 帶背景圖像的Java卡布局
- 28. 刷卡視圖或佈局的Android
- 29. Android佈局文件夾:佈局,佈局端口,佈局區域
- 30. 修改一個視圖,我卡住了