2017-08-08 16 views
1

是否可以从Material-UI标题设置AppBar而不是内联方式? 我有一个css文件分开,我想改变标题的大小,例如。Material-UI应用程序栏标题样式

某事像这样:

.app-bar title { 
    font-size: 120px !important; 
} 

谢谢:)

回答

1

尝试.app-bar h1.app-bar *样式的CSS代码,然后把的.app,酒吧AppBar组件的className

1

正如你所看到的在文档中,http://www.material-ui.com/#/components/app-bar组件接受className作为wrappper并且没有class的h1标签,因此您可以尝试:

.app-bar h1 { 
font-size: 120px !important; 

}

<AppBar className='app-bar' /> 
+1

我解决了这个问题,但是又怎么样!importants因为它不起作用,所以它看起来像这样: .app-bar {background} color:#de6927!important; 职位:固定!重要; top:0!important; 显示:flex!important; flex-direction:row!important; align-items:center!important; } – Ernesto

2

我解决了这个问题。解决方案:

<AppBar className="app-bar" 
          title={<div className="app-bar-title">Tomek The Title</div>} 

然后在css文件中可以添加样式。

相关问题