- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我构建 This菜单,我无法将左侧的输入设置为与右侧的输入高度相同...我正在考虑的解决方案是将输入的 div 设置为相同高度,然后使用 flex-grow - 和将字段 7 设置为其高度的两倍......我已经尝试过但它不起作用 - 也许他们是更好的方法?我也尝试使用 bootstrap 这样做 - 但遇到了同样的问题。
HTML :
<div class="container">
<div class="tab-pane active" id="mes_informations">
<div class="row">
<div class="col-md-10">
<div class="row">
<div class="col-md-6 mes_informations_left_cont">
<div class="inputs_grp">
<p>field 1</p>
<div class="switch_div_info">
<div class="switch" style="border-radius:25px;">
<input type="radio" class="switch-input" name="view" value="" id="week" checked="">
<label for="week" class="switch-label switch-label-off male">
<i class="fa fa-mars" aria-hidden="true"></i>
<label>
Homme
</label>
</label>
<input type="radio" class="switch-input" name="view" value="" id="month">
<label for="month" class="switch-label switch-label-on female">
<label>
Femme
</label> <i class="fa fa-venus" aria-hidden="true"></i></label>
<span class="switch-selection"></span>
</div>
</div>
</div>
<div class="inputs_grp">
<p>field 2</p>
<input class="form-control" id="societe" type="text">
</div>
<div class="inputs_grp">
<p>field 3</p>
<input class="form-control" id="siren" type="text">
</div>
<div class="inputs_grp">
<p>field 3</p>
<input class="form-control" id="nom_contact" type="text">
</div>
<div class="inputs_grp">
<p>field 4</p>
<input class="form-control" id="prenom_contact" type="text">
</div>
</div>
<div class="col-md-6 mes_informations_right_cont">
<div class="inputs_grp">
<p>field 5</p>
<input class="form-control" id="service" type="text">
</div>
<div class="inputs_grp">
<p>field 6</p>
<input class="form-control" id="address" type="text">
</div>
<div class="inputs_grp input_double">
<p>field 7</p>
<input class="form-control" id="address_fac" type="text">
<div class="address_input_grp">
<input class="form-control pull-left" id="vile" type="text">
<input class="form-control pull-right" id="code_postal" type="text">
</div>
</div>
<div class="inputs_grp">
<p>field 8</p>
<input class="form-control" id="nom_contact_fac" type="text">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS:
.container {
padding: 15px;
height: 800px;
width: 800px;
background-color: #e9e9e9;
}
.switch_div_info .switch {
float: left;
position: relative;
height: 32px;
width: 140px;
/*margin: 20px auto;*/
background: white;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
}
.switch_div_info .switch-label {
position: relative;
z-index: 2;
float: left;
width: 58px;
line-height: 26px;
font-size: 11px;
color: rgba(255, 255, 255, 0.35);
text-align: center;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
cursor: pointer;
}
.switch_div_info .switch-label label {
font-family: 'Montserrat', sans-serif;
color: #2b2b2b;
display: none;
font-size: 12px;
position: relative;
display: none;
font-weight: 100;
}
.switch_div_info .switch-label:active {
font-weight: bold;
}
.switch_div_info .switch-label-off {
padding-left: 2px;
}
.switch_div_info .switch-label-on {
padding-right: 2px;
}
.switch_div_info .switch-input {
display: none;
}
.switch_div_info .switch-input:checked + .switch-label {
font-weight: bold;
color: rgba(0, 0, 0, 0.65);
text-shadow: 0 1px rgba(255, 255, 255, 0.25);
-webkit-transition: 0.15s ease-out;
-moz-transition: 0.15s ease-out;
-ms-transition: 0.15s ease-out;
-o-transition: 0.15s ease-out;
transition: 0.15s ease-out;
-webkit-transition-property: color, text-shadow;
-moz-transition-property: color, text-shadow;
-ms-transition-property: color, text-shadow;
-o-transition-property: color, text-shadow;
transition-property: color, text-shadow;
}
.switch_div_info .switch-input:checked + .switch-label label {
display: block;
}
.switch_div_info .switch-input:checked + .switch-label-on ~ .switch-selection {
left: 45px;
/* Note: left: 50%; doesn't transition in WebKit */
}
.switch_div_info .switch-selection {
position: absolute;
z-index: 1;
top: -1px;
left: 0px;
display: block;
width: 105px;
height: 36px;
border-radius: 3px;
background-color: white;
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.5), 0 0 2px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px rgba(255, 255, 255, 0.5), 0 0 2px rgba(0, 0, 0, 0.2);
-webkit-transition: left 0.15s ease-out;
-moz-transition: left 0.15s ease-out;
-ms-transition: left 0.15s ease-out;
-o-transition: left 0.15s ease-out;
transition: left 0.15s ease-out;
border-radius: 25px;
}
.switch_div_info .switch .switch-label .fa {
font-size: 20px;
margin-top: 6px;
}
.switch_div_info .switch .switch-label.male {
float: left;
}
.switch_div_info .switch .switch-label.female {
float: right;
}
.switch_div_info .switch .switch-label.male .fa {
float: left;
margin-left: 5px;
}
.switch_div_info .switch .switch-label.female .fa {
float: right;
margin-right: 5px;
}
.switch_div_info .switch .switch-label.male label {
left: 31px;
top: -23px;
}
.switch_div_info .switch .switch-label.female label {
right: 26px;
top: 3px;
}
.switch_div_info .switch-input:checked + .switch-label.female .fa {
position: relative;
top: -30px;
}
.switch_div_info .switch-input:checked + .switch-label .fa {
color: rgb(73, 200, 193);
}
#mes_informations .cont {
display: flex;
}
#mes_informations P {
font-family: 'Montserrat', sans-serif;
font-size: 0.8vw;
color: #2b2b2b;
}
.mes_informations_left_cont {
min-height: 400px;
display: flex;
flex-direction: column;
justify-content: space-between;
flex-wrap: wrap;
align-items: stretch;
}
.mes_informations_right_cont {
min-height: 400px;
display: flex;
flex-direction: column;
justify-content: space-between;
flex-wrap: wrap;
align-items: stretch;
}
#mes_informations .cont .left_cont > .inputs_grp,
#mes_informations .cont .right_cont > .inputs_grp {}
/*.left_cont > .inputs_grp, .right_cont > .inputs_grp {*/
/*min-height: 60px;*/
/*margin-top: 17px;*/
/*margin-bottom: 15px;*/
/*}*/
/*.address_grp{
min-height: 136px!important;
}*/
/*.address_input_grp{*/
/*padding-top: 15px;*/
/*}*/
.address_input_grp > input {
width: 48%;
}
#save_info:hover {
background-color: #40afa9;
outline: none;
}
#save_info {
background-color: #49c8c1;
border: 1px solid white;
border-radius: 5px;
font-size: 0.8vw;
padding: 5px 15px 5px 15px;
color: #fff;
outline: none;
}
.inputs_grp > .form-control {
border-radius: 5px!important;
}
.inputs_grp {
flex-grow: 1;
}
最佳答案
通过将所有输入更改为由 flexbox 内联来修复。
html
<div class="wrapper">
<div class="grp_wrap">
<div class="inputs_grp">
<p>CIVILITÉ</p>
<div class="switch_div_info">
<div class="switch" style="border-radius:25px;">
<input type="radio" class="switch-input" name="view" value="" id="week" checked="">
<label for="week" class="switch-label switch-label-off male">
<i class="fa fa-mars" aria-hidden="true"></i>
<label>
Homme
</label>
</label>
<input type="radio" class="switch-input" name="view" value="" id="month">
<label for="month" class="switch-label switch-label-on female">
<label>
Femme
</label> <i class="fa fa-venus" aria-hidden="true"></i></label>
<span class="switch-selection"></span>
</div>
</div>
</div>
<div class="inputs_grp">
<p>SERVICE À FACTURER</p>
<input class="form-control" id="service" type="text">
</div>
</div>
<div class="grp_wrap">
<div class="inputs_grp">
<p>SOCIÉTÉ</p>
<input class="form-control" id="societe" type="text">
</div>
<div class="inputs_grp">
<p>ADRESSE DE FACTURATION</p>
<input class="form-control" id="address" type="text">
</div>
</div>
<div class="grp_wrap">
<div class="inputs_grp">
<p>SIRET/SIREN</p>
<input class="form-control" id="siren" type="text">
</div>
<div class="inputs_grp">
<p>ADRESSE</p>
<input class="form-control" id="address_fac" type="text">
</div>
</div>
<div class="grp_wrap">
<div class="inputs_grp">
<p>PRÉNOM DU CONTACT PRINCIPAL</p>
<input class="form-control" id="prenom_contact" type="text">
</div>
<div class="inputs_grp address_input_grp">
<input class="form-control pull-left" id="vile" type="text">
<input class="form-control pull-right" id="code_postal" type="text">
</div>
</div>
<div class="grp_wrap">
<div class="inputs_grp">
<p>PRÉNOM DU CONTACT PRINCIPAL</p>
<input class="form-control" id="prenom_contact" type="text">
</div>
<div class="inputs_grp">
<p>NOM DE CONTACT DE FACTURATION</p>
<input class="form-control" id="nom_contact_fac" type="text">
</div>
</div>
</div>
CSS:
.wrapper{
width:80%;
}
.inputs_grp{
width:48%;
margin-bottom:15px;
}
.grp_wrap{
display:flex;
}
.switch_div_info .switch {
float: left;
position: relative;
height: 32px;
width: 140px;
/*margin: 20px auto;*/
background: white;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
}
.switch_div_info .switch-label {
position: relative;
z-index: 2;
float: left;
width: 58px;
line-height: 26px;
font-size: 11px;
color: rgba(255, 255, 255, 0.35);
text-align: center;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
cursor: pointer;
}
.switch_div_info .switch-label label {
font-family: 'Montserrat', sans-serif;
color: #2b2b2b;
display: none;
font-size: 12px;
position: relative;
display: none;
font-weight: 100;
}
.switch_div_info .switch-label:active {
font-weight: bold;
}
.switch_div_info .switch-label-off {
padding-left: 2px;
}
.switch_div_info .switch-label-on {
padding-right: 2px;
}
.switch_div_info .switch-input {
display: none;
}
.switch_div_info .switch-input:checked + .switch-label {
font-weight: bold;
color: rgba(0, 0, 0, 0.65);
text-shadow: 0 1px rgba(255, 255, 255, 0.25);
-webkit-transition: 0.15s ease-out;
-moz-transition: 0.15s ease-out;
-ms-transition: 0.15s ease-out;
-o-transition: 0.15s ease-out;
transition: 0.15s ease-out;
-webkit-transition-property: color, text-shadow;
-moz-transition-property: color, text-shadow;
-ms-transition-property: color, text-shadow;
-o-transition-property: color, text-shadow;
transition-property: color, text-shadow;
}
.switch_div_info .switch-input:checked + .switch-label label {
display: block;
}
.switch_div_info .switch-input:checked + .switch-label-on ~ .switch-selection {
left: 45px;
/* Note: left: 50%; doesn't transition in WebKit */
}
.switch_div_info .switch-selection {
position: absolute;
z-index: 1;
top: -1px;
left: 0px;
display: block;
width: 105px;
height: 36px;
border-radius: 3px;
background-color: white;
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.5), 0 0 2px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px rgba(255, 255, 255, 0.5), 0 0 2px rgba(0, 0, 0, 0.2);
-webkit-transition: left 0.15s ease-out;
-moz-transition: left 0.15s ease-out;
-ms-transition: left 0.15s ease-out;
-o-transition: left 0.15s ease-out;
transition: left 0.15s ease-out;
border-radius: 25px;
}
.switch_div_info .switch .switch-label .fa {
font-size: 20px;
margin-top: 6px;
}
.switch_div_info .switch .switch-label.male {
float: left;
}
.switch_div_info .switch .switch-label.female {
float: right;
}
.switch_div_info .switch .switch-label.male .fa {
float: left;
margin-left: 5px;
}
.switch_div_info .switch .switch-label.female .fa {
float: right;
margin-right: 5px;
}
.switch_div_info .switch .switch-label.male label {
left: 31px;
top: -23px;
}
.switch_div_info .switch .switch-label.female label {
right: 26px;
top: 3px;
}
.switch_div_info .switch-input:checked + .switch-label.female .fa {
position: relative;
top: -30px;
}
.switch_div_info .switch-input:checked + .switch-label .fa {
color: rgb(73, 200, 193);
}
关于html - 如何使用 Flexbox 将输入定位在等高位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46174389/
我必须从我的网站中删除()一些iem,然后将它们追加()回来,但是当我追加它们时,它们出现在不同的地方,而我希望它们完全显示在它们以前的同一个地方是。 有什么解决办法吗? 这是一个沙箱,请随意更新(注
一个。图片 (960x7)b. div(宽度:960,填充:10) 我想定位 (a),使其距顶部 50 像素,居中。我想将 (b) 放置在 (a) 的正下方,没有空格。 我的 CSS 如下: @cha
放置某物的正确方法是什么?我有一个在中心显示博客文章的 div。 "" rel="bookmark"> BY LOUIS MOORE ON " pubdate>
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭1
我已经成功地使用了 position:fixed 设置 CSS/CSS3 并且工作得很好! 我几天前看到了这个,想知道他们是如何实现向下滚动时发生的效果的,菜单栏在滚动前处于一个位置,然后转到顶部并自
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 7 年前。 Improv
接口定义 能够对于文字、段落乃至任何元素的精准定位 并做出增删改查,都是在开发一款富文本编辑器时一项最基本也是最重要的功能之一。让我们先来看看Slate中对于如何在文档树中定位元素是怎么定义的
例如,使用 WPF 在选项卡控件的最左上角定位三个 tabitem 和在最右上角定位一个 tabitem 的正确方法是什么? 我尝试通过更改边距将第四个 tabitem 向右移动,但这并没有产生好的结
我正在尝试使用 Javascript 创建一个跟随鼠标在页面上移动的东西。我希望它是米老鼠,我希望他的眼睛跟随鼠标移动他的眼球...这是我到目前为止的代码(从网络上的各个地方收集,因此归功于编写该部分
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 已关闭 9 年前。 Improve
我试图将两个按钮放置在左上角。但它们始终位于顶部中心。 我已经尝试过这个: jp = new JPanel(); jp.setLayout(new GridBagLayout()); GridBagC
我在使用 JQuery 向下滑动功能时遇到问题。我可以让它正常工作,但是我向下滑动的元素的位置会根据视口(viewport)的大小而变化。我想做的是将它与它滑动的元素联系起来。 This JSfidd
我正在尝试创建一个棋盘,并将其放置在屏幕中间,但到目前为止我无法将它直接放在中间。我不想将位置硬编码到屏幕上,因为我要处理不同的屏幕尺寸。 var winsize = cc.director.
我正在尝试从 mysql 中的 2 个字符串点之间提取数据,我的示例脚本是 'otherdata&p1=textneeded&otherdata' 我需要拉出“textneeded”位,“P1=”是起
如何在 JavaFX 中设置按钮的位置?我的代码: bZero = new Button(); bZero.setPrefSize(45, 20); mainPane.getChildren().ad
我有一个 iPhone 应用程序,我可以在其中显示一系列图像。当用户点击图像时,我需要将该图像带到第一个位置,表明它是所选图像。我可以通过子类化实现 uiscrollview 中的点击。但是我无法将
在下图中,它显示了一个image、textbox 和一个css menu image 我的 CSS 菜单非常完美。我终于按照我需要的方式得到了它。我的问题是我需要导航栏中央的文本框,然后我需要我的图像
我必须创建一个看起来像这样的 div id为2的div应该出现在图片的右下角,图片的大小不固定id=2的div应该应用什么css id =1 的 div 没有定义位置,所以使用默认值,图像也是
如何将我的文本和图像对齐在同一行? 每当我使用 padding 或 margins 时,它就会崩溃到我正在使用的圆形图像中。 #alignPhoto { padding-right: 50px;
简单的问题,如何定位具有整个页面引用的元素? 在我的例子中,我在标题中得到了一个 float 图像,然后是 2 组标题。当我使用时: text-align: center; 它使用图像宽度端和页面其余
我是一名优秀的程序员,十分优秀!