将样式应用于 Material2 组件不起作用 [英] Applying style to Material2 component does not work

查看:27
本文介绍了将样式应用于 Material2 组件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 元素:

<md-input class="filter-name-input" [(ngModel)]="name" placeholder="Name"></md-input>

我正在尝试通过 CSS 对其应用样式:

And am trying to apply styling to it via a CSS:

md-input {
    height: 2000000px;
}

我没有看到在浏览器调试器中应用的样式.我这样做是否不当?

I'm not seeing the style being applied in the browser debugger. Am I doing this improperly?

推荐答案

不,你做得对,看看这个 plunker

No you are doing right have a look at this plunker

工作示例

<md-input #startDate
          required
          name="startDate"
          placeholder="startDate">
</md-input>
</p> 

<style>
  md-input{height:1000px; background:red;}
</style>

实际上 css 高度正在应用到您的组件,但由于白色背景可能不可见,请参阅随附的 plunker,它对我来说工作正常.

actually css height is being applied to your component but may not be visible due to white background, see in the attached plunker its working fine for me.

这篇关于将样式应用于 Material2 组件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆