gpt4 book ai didi

html - 风格不以形式改变

转载 作者:太空宇宙 更新时间:2023-11-04 08:04:22 24 4
gpt4 key购买 nike

我在桥梁主题中使用 Contact Form 7。

我尝试自定义表单以便有 2 列并且文本与用户编写代码的框在同一行。

我的问题是,即使我使用样式来更改高度和宽度并设置边框,也没有采用样式。知道为什么会发生这种情况吗?

#left_form7 {
width: 47%;
float: left;
margin-right:6%;
}

#right_form7 {
width: 47%;
float: left;
}

.clearfix_form7:after {
content:"\0020";
display:block;
height:0;
clear:both;
visibility:hidden;
overflow:hidden;
margin-bottom:10px;
}

.clearfix_form7 {
display:block;
}

span.label_form7 {
float: left;
width: 180px;
}

span.form-input_form7 {
float: left;
width: 200px;
}
<div class="clearfix_form7">
<div id="left_form7">
<span class="label_form7">First name</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text first-name]</span><br/> <br/>
<span class="label_form7">Last name</span><span class="form-input_form7" style= "border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text last-name]</span><br/> <br/>
<span class="label_form7">How Did You Find Us?</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text text-find-us]</span><br/>
</div>
<div id="right">
<span class="label_form7">Email</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[email* your-email]</span><br/> <br/>
<span class="label_form7">Phone</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text your-phone]</span>
</div>
</div></div>

Subject [text* your-subject] <br/>
Message [textarea* your-message]<br/>
[submit "Send"]

Here现在的输出示例,据我所知,盒子似乎没有改变。

最佳答案

试试这个,您不需要在每个输入元素上重复相同的样式。你有 form-input_form7 类来选择它们,如果你把 height: 5px 放在内联样式中,你就不能用外部 css 覆盖它。

#left_form7 {
width: 47%;
float: left;
margin-right:6%;
}

#right_form7 {
width: 47%;
float: left;
}

.clearfix_form7:after {
content:"\0020";
display:block;
height:0;
clear:both;
visibility:hidden;
overflow:hidden;
margin-bottom:10px;
}

.clearfix_form7 {
display:block;
}

span.label_form7{
float: left;
width: 180px;
}

span.form-input_form7{
float: left;
width: 200px;
border-width:2px;
border-style: solid;
border-color: #000000;
}
<div class="clearfix_form7">
<div id="left_form7">
<span class="label_form7">First name</span><span class="form-input_form7">[text first-name]</span><br/> <br/>
<span class="label_form7">Last name</span><span class="form-input_form7">[text last-name]</span><br/> <br/>
<span class="label_form7">How Did You Find Us?</span><span class="form-input_form7">[text text-find-us]</span><br/>
</div>
<div id="right_form7">
<span class="label_form7">Email</span><span class="form-input_form7">[email* your-email]</span><br/> <br/>
<span class="label_form7">Phone</span><span class="form-input_form7">[text your-phone]</span>
</div>
</div>

Subject [text* your-subject] <br/>
Message [textarea* your-message]<br/>
[submit "Send"]

关于html - 风格不以形式改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46776506/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com