gpt4 book ai didi

html - 一行中的两个输入字段

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

我正在尝试使用 Twitter Bootstrap 在同一行显示两个注册字段。

<div class="form-group required">
<label class="col-sm-2 control-label" for="input-firstname"><?php echo $entry_firstname; ?></label>
<div class="col-sm-10">
<input type="text" name="firstname" value="<?php echo $firstname; ?>" placeholder="<?php echo $entry_firstname; ?>" id="input-firstname" class="form-control" />
<?php if ($error_firstname) { ?>
<div class="text-danger"><?php echo $error_firstname; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-lastname"><?php echo $entry_lastname; ?></label>
<div class="col-sm-10">
<input type="text" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $entry_lastname; ?>" id="input-lastname" class="form-control" />
<?php if ($error_lastname) { ?>
<div class="text-danger"><?php echo $error_lastname; ?></div>
<?php } ?>
</div>
</div>

我该怎么做?

最佳答案

在 bootstrap 中,您可以交替嵌套列和行,应该这样做:

<div class="row">
<div class="col-xs-12 col-sm-6">
<div class="form-group required">
<label class="col-xs-12 col-sm-2 control-label" for="input-firstname"><?php echo $entry_firstname; ?></label>
<div class="col-xs-12 col-sm-10">
<input type="text" name="firstname" value="<?php echo $firstname; ?>" placeholder="<?php echo $entry_firstname; ?>" id="input-firstname" class="form-control" />
<?php if ($error_firstname) { ?>
<div class="text-danger"><?php echo $error_firstname; ?></div>
<?php } ?>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group required">
<label class="col-xs-12 col-sm-2 control-label" for="input-lastname"><?php echo $entry_lastname; ?></label>
<div class="col-xs-12 col-sm-10">
<input type="text" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $entry_lastname; ?>" id="input-lastname" class="form-control" />
<?php if ($error_lastname) { ?>
<div class="text-danger"><?php echo $error_lastname; ?></div>
<?php } ?>
</div>
</div>
</div>
</div>

关于html - 一行中的两个输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38770184/

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