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. 修改一个视图,我卡住了