首页 > 解决方案 > 问题下方的单选按钮未与其对齐

问题描述

我一直在尝试对齐问题开头下方的单选按钮的位置,但似乎没有什么对我有用。

在此处输入图像描述

这是我的代码:

<div class="form-row" [style.display]="this.Form.value.joiningAs == '2' || this.Form.value.joiningAs == '3' ? 'block' : 'none'">
  <div class="col-md-12 mb-3">
    <label for="hasProfile">
                            Has your company created their profile on our platform?
                        </label>
    <div class="form-check">
      <label class="form-check-label">
                                <input type="radio" class="radio" name="hasCompanyProfile" value="1" formControlName="hasCompanyProfile"
                                    [(ngModel)]="Form.value.hasCompanyProfile">
                                Yes
                            </label>
    </div>
    <div class="form-check">
      <label class="form-check-label">
                                <input type="radio" class="radio" name="hasCompanyProfile" value="2" formControlName="hasCompanyProfile"
                                    [(ngModel)]="Form.value.hasCompanyProfile">
                                No
                            </label>
    </div>
  </div>
</div>

任何帮助将不胜感激。我在这件事上花费了太多时间。

标签: htmlradio-group

解决方案


因此,您想将左侧的单选按钮与文本对齐吗?

.form-check-label > input {
    margin-left: 0;
}

我希望能解决你的问题


推荐阅读