gpt4 book ai didi

html - CSS将2个表单域并排放置

转载 作者:行者123 更新时间:2023-11-28 01:25:56 27 4
gpt4 key购买 nike

我在网上找到了一个表格,现在我正在尝试修改它,将电话和电子邮件文本字段放在一起。我有点设法得到它,但格式不正确。这些字段很小,当我尝试将它们变大以匹配全名字段时,电话字段会转到全名结尾的位置,但它不起作用。我一直在网上搜索所有内容,但无法正常工作。非常感谢任何帮助。

.form-style-10 {
width: 900px;
padding: 30px;
margin: 40px auto;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
-moz-box-shadow: :0px 0px 10px rgba(0, 0, 0, 0.13);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
}

.form-style-10 .inner-wrap {
padding: 30px;
background: #F8F8F8;
border-radius: 6px;
margin-bottom: 15px;
}

.form-style-10 h1 {
background: #2A88AD;
padding: 20px 30px 15px 30px;
margin: -30px -30px 30px -30px;
border-radius: 10px 10px 0 0;
-webkit-border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'Bitter', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #257C9E;
}

.form-style-10 h1>span {
display: block;
margin-top: 2px;
font: 13px Arial, Helvetica, sans-serif;
}

.form-style-10 label {
display: block;
font: 13px Arial, Helvetica, sans-serif;
color: #888;
margin-bottom: 15px;
}

.form-style-10 input[type="text"],
.form-style-10 input[type="date"],
.form-style-10 input[type="datetime"],
.form-style-10 input[type="email"],
.form-style-10 input[type="number"],
.form-style-10 input[type="search"],
.form-style-10 input[type="time"],
.form-style-10 input[type="url"],
.form-style-10 input[type="password"],
.form-style-10 textarea,
.form-style-10 select {
display: block;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100%;
padding: 8px;
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border: 2px solid #fff;
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
-moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
-webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
}

.form-style-10 .section {
font: normal 20px 'Bitter', serif;
color: #2A88AD;
margin-bottom: 5px;
}

.form-style-10 .section span {
background: #2A88AD;
padding: 5px 10px 5px 10px;
position: absolute;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border: 4px solid #fff;
font-size: 14px;
margin-left: -45px;
color: #fff;
margin-top: -3px;
}

.form-style-10 input[type="button"],
.form-style-10 input[type="submit"] {
background: #2A88AD;
padding: 8px 20px 8px 20px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'Bitter', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #257C9E;
font-size: 15px;
}

.form-style-10 input[type="button"]:hover,
.form-style-10 input[type="submit"]:hover {
background: #2A6881;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
}

.form-style-10 .privacy-policy {
float: right;
width: 250px;
font: 12px Arial, Helvetica, sans-serif;
color: #4D4D4D;
margin-top: 10px;
text-align: right;
}
<div class="form-style-10">
<h1>Request Your Quote<span>Request your free quote today!</span></h1>
<form>
<div class="section"><span>1</span>Contact Information</div>
<div class="inner-wrap" style="display:inline-block !important;">
<label>Your Full Name<input type="text" name="field1" /></label>
<div style="float:right !important; padding-right:50px; display:inline-block !important;"><label>Phone<input type="text" style="max-width:300px !important;" name="field1" /></label></div>
<div style="float:left !important; display:inline-block !important;padding-right: 300px;">
<label>Email<input type="text" style="max-width:300px !important;" name="field1" /></label></div>
</div>
<div class="button-section">
<input type="submit" name="Sign Up" />
<span class="privacy-policy">
<input type="checkbox" name="field7">You agree to our Terms and Policy.
</span>
</div>
</form>
</div>

最佳答案

冒着无法提供完整解决方案的风险,这是一次尝试。我使两个输入都向左浮动,向内部环绕元素 (760px) 添加了一个宽度值,并将两个输入都设为 50% 宽度。

.form-style-10 {
width: 900px;
padding: 30px;
margin: 40px auto;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
-moz-box-shadow: :0px 0px 10px rgba(0, 0, 0, 0.13);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
}

.form-style-10 .inner-wrap {
padding: 30px;
background: #F8F8F8;
border-radius: 6px;
margin-bottom: 15px;
width: 700px;
}

.form-style-10 h1 {
background: #2A88AD;
padding: 20px 30px 15px 30px;
margin: -30px -30px 30px -30px;
border-radius: 10px 10px 0 0;
-webkit-border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'Bitter', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #257C9E;
}

.form-style-10 h1>span {
display: block;
margin-top: 2px;
font: 13px Arial, Helvetica, sans-serif;
}

.form-style-10 label {
display: block;
font: 13px Arial, Helvetica, sans-serif;
color: #888;
margin-bottom: 15px;
}

.form-style-10 input[type="text"],
.form-style-10 input[type="date"],
.form-style-10 input[type="datetime"],
.form-style-10 input[type="email"],
.form-style-10 input[type="number"],
.form-style-10 input[type="search"],
.form-style-10 input[type="time"],
.form-style-10 input[type="url"],
.form-style-10 input[type="password"],
.form-style-10 textarea,
.form-style-10 select {
display: block;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100%;
padding: 8px;
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border: 2px solid #fff;
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
-moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
-webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
}

.form-style-10 .section {
font: normal 20px 'Bitter', serif;
color: #2A88AD;
margin-bottom: 5px;
}

.form-style-10 .section span {
background: #2A88AD;
padding: 5px 10px 5px 10px;
position: absolute;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border: 4px solid #fff;
font-size: 14px;
margin-left: -45px;
color: #fff;
margin-top: -3px;
}

.form-style-10 input[type="button"],
.form-style-10 input[type="submit"] {
background: #2A88AD;
padding: 8px 20px 8px 20px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'Bitter', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #257C9E;
font-size: 15px;
}

.form-style-10 input[type="button"]:hover,
.form-style-10 input[type="submit"]:hover {
background: #2A6881;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
}

.form-style-10 .privacy-policy {
float: right;
width: 250px;
font: 12px Arial, Helvetica, sans-serif;
color: #4D4D4D;
margin-top: 10px;
text-align: right;
}
<div class="form-style-10">
<h1>Request Your Quote<span>Request your free quote today!</span></h1>
<form>
<div class="section"><span>1</span>Contact Information</div>
<div class="inner-wrap" style="display:inline-block !important;">
<label>Your Full Name<input type="text" name="field1" /></label>
<div style="float:left !important; display:inline-block !important; width: 50%;"><label>Phone<input type="text" style="max-width:300px !important;" name="field1" /></label></div>
<div style="float:left !important; display:inline-block !important; width: 50%;">
<label>Email<input type="text" style="max-width:300px !important;" name="field1" /></label></div>
</div>
<div class="button-section">
<input type="submit" name="Sign Up" />
<span class="privacy-policy">
<input type="checkbox" name="field7">You agree to our Terms and Policy.
</span>
</div>
</form>
</div>

关于html - CSS将2个表单域并排放置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51248639/

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