php - 并排对齐两个输入字段

标签 php html css class

我知道这是一个非常愚蠢的问题,但我已经尝试了所有方法(div 包装器、 float div、p 类),但无法弄清楚。我只想并排对齐第二列上的“isim & soyisim”字段(这些是姓名字段)。我的代码有问题,但我找不到它,这让我发疯。任何帮助将不胜感激。在这里查看:

http://www.wondercatspopup.com/hesabim/

代码如下:

     <p class="form-row form-row-first">
          <label style="display:none!important;" for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?>
            <span class="required">
             *
            </span>
          </label>

          <input type="text" class="woocommerce-Input woocommerce-Input--text input-text placeholder" placeholder="İsim *" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" />
    
         <label style="display:none!important;" for="reg_billing_last_name"><?php _e( 'Last name', 'woocommerce' ); ?><span class="required">*</span></label>
         <input type="text" class="woocommerce-Input woocommerce-Input--text input-text placeholder" placeholder="Soyisim *" name="billing_last_name" id="reg_billing_last_name" value="<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>" />
       
      </p>

      <p class="form-row form-row-wide">

          <label style="display:none!important;" for="reg_billing_phone"><?php _e( 'Phone', 'woocommerce' ); ?></label>
          <input type="text" class="woocommerce-Input woocommerce-Input--text input-text placeholder" placeholder="Telefon *" name="billing_phone" id="reg_billing_phone" value="<?php esc_attr_e( $_POST['billing_phone'] ); ?>" />
      </p>

       <div class="clear"></div>

最佳答案

您的文本框使用了屏幕的全宽。

尝试使用 display: inline-block 属性为文本框设置特定宽度。

示例: HTML

<div>
<input type="text" name="firstname" />
<input type="text" name="lastname" />
</div>

风格

input[type="text"] {
    width: 150px;
    display: inline-block;
}

关于php - 并排对齐两个输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46106735/

相关文章:

php - 带有变量和参数的东西(准备好的语句)

jquery - 如何使用 jquery.load() 在内容之前加载页眉和页脚

javascript - 在不提交的情况下启动浏览器的验证和错误消息

html - 在中心排列三个 DIV

html - Bootstrap 可折叠不降低视差

php - 在 for 循环的下拉列表中选择 mysql php 预加载

php - SMTP Gmail 服务器 SSL 错误

php - 将 SQL 数据库中的数据显示到 php/html 表中

javascript - jQuery 什么都不做

asp.net - div 内的 Updatepanel 与我的 css 重叠