简体   繁体   English

md-input-container和标签未对齐

[英]md-input-container and label not aligned

I am trying to create a filter for price, and I am stuck on aligning these elements correctly. 我正在尝试为价格创建一个过滤器,并且坚持正确地调整这些元素。

With this code: 使用此代码:

<div formGroupName="price.baseMSRP" fxLayout="row">
    <span>Price</span>

    <md-input-container>
        <input mdInput type="number" min="{{data.price.min}}" max="{{data.price.max}}" step="1000"
               placeholder="Min:" value="{{data.price.min}}" formControlName="$gte" (change)="onUpdate(form.value)" />
    </md-input-container>
    <span>to</span>
    <md-input-container>
        <input mdInput type="number" min="{{data.price.min}}" max="{{data.price.max}}" step="1000"
               placeholder="Max:" value="{{data.price.max}}" formControlName="$lte" (change)="onUpdate(form.value)" />
    </md-input-container>
</div>

Yields this result: 产生以下结果:

折价

How can I edit the HTML/CSS in order to make this look a little more aligned and space them out a little? 我如何编辑HTML / CSS,以使外观看起来更加对齐并隔开一些空间?

Ideally, I would like for "Price" and "to" to line up with "11990" and "247900." 理想情况下,我希望“价格”和“至”与“ 11990”和“ 247900”对齐。 How can this be done (with Flexbox)? 如何做到这一点(使用Flexbox)?

Thanks 谢谢

For those who are wondering to align text with md-input container 对于那些想将文本与md-input容器对齐的人

create a css property: 创建一个CSS属性:

.range-to {
    padding-top: 13px;
    padding-left: 20px;
}

using 使用

<md-content>
  <label>test</label>
  <md-input-container>
     <input  type="number"/>
  </md-input-container>
</md-content>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM