如何将HTML文本框与HTML按钮对齐?

时间:2017-05-06 01:45:19

标签: html

我正在尝试将HTML文本框与我的HTML按钮对齐,而不会在移动设备上显示不同的内容。两个文本框的宽度与按钮的宽度相同。但是,它们似乎根本没有对齐,而是使页面看起来很草率。 请注意,我已经在多个浏览器上尝试了这个,结果都给了我上面提到的内容。请帮忙!

enter image description here

<div id="worked">&nbsp;</div>
<h1 style="text-align: center;"><span style="color: #ff0000;"><strong>Offer Ends In:</strong></span></h1>
<h1 id="time" style="text-align: center;">&nbsp;</h1>
<p>&nbsp;</p>
<!-- AWeber Web Form Generator 3.0.1 --><form class="af-form-wrapper" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl" method="post">
<div style="display: none;"><input name="meta_web_form_id" type="hidden" value="604218668" /> <input name="meta_split_id" type="hidden" value="" /> <input name="listname" type="hidden" value="awlist4661276" /> <input id="redirect_56ab2ff33416d920a3c24dc4d8e140f4" name="redirect" type="hidden" value="http://bloggingnetworkonline.com/InternetMarketing/?page_id=133&amp;preview=true" /> <input name="meta_adtracking" type="hidden" value="My_Web_Form" /> <input name="meta_message" type="hidden" value="1" /> <input name="meta_required" type="hidden" value="name,email" /> <input name="meta_tooltip" type="hidden" value="name||First Name...,,email||Best Email..." /></div>
<div id="af-form-604218668" class="af-form">
<div id="af-body-604218668" class="af-body af-standards">
<div class="af-element"><label class="previewLabel" for="awf_field-90534028"></label>
<div class="af-textWrap" style="text-align: center;"><input id="awf_field-90534028" class="text" style="width: 450px; text-align: left;" tabindex="500" name="name" type="text" value="First Name..." /></div>
</div>
<div class="af-element" style="text-align: center;"><label class="previewLabel" for="awf_field-90534029"></label>
<div class="af-textWrap" style="text-align: center;"><input id="awf_field-90534029" class="text" style="width: 450px; position: center;" tabindex="500" name="email" type="text" value="Best Email..." /></div>
</div>
<div class="af-element buttonContainer" style="text-align: center;"><input id="af-submit-image-604218668" class="image" style="background: none; max-width: 100%; width: 450px position: center;" tabindex="502" alt="Submit Form" name="submit" src="https://hostedimages-cdn.aweber-static.com/MTE0ODQyNQ==/original/d316599087b84f9498e3854009bdad52.png" type="image" /></div>
<div class="af-element privacyPolicy" style="text-align: center;">
<p><strong>I respect your <a title="Privacy Policy" href="https://www.aweber.com/permission.htm" target="_blank" rel="nofollow">email privacy</a></strong></p>
<div class="af-clear">&nbsp;</div>
</div>
</div>
</div>
<div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=bAwsTIwcbGwc" alt="" /></div>
</form><!-- /AWeber Web Form Generator 3.0.1 -->
<script>// <![CDATA[
var handler = function() {
if (--sec < 0) {
  sec = 59;
  if (--min < 0) {
    min = 0;
    sec = 0;
  }
}
var min1 = "0" + min + "m";
var min2 = min + "m";
var sec1 = "0" + sec + "s";
var sec2 = sec + "s";
var col = ":";
min1 = min1.fontcolor("red");
min2 = min2.fontcolor("red");
sec1 = sec1.fontcolor("red");
sec2 = sec2.fontcolor("red");
col = col.fontcolor("red");
document.getElementById("time").innerHTML = (min < 10 ? min1 : min2) + col + (sec < 10 ? sec1 : sec2);
  };
  var sec = 0;
  var min = 15;
  handler();
  setInterval(handler, 1000);
// ]]></script>

1 个答案:

答案 0 :(得分:0)

使用css库,如bootstrap或其他东西。这将有助于您获得页面的响应格式。