Css sencha中的按钮背景色
我是新来的森查触摸。 如何将按钮的背景色更改为白色?我有一个按钮,每个角落有两个图像。我希望按钮是纯白色的。 我试着像这样使用css:Css sencha中的按钮背景色,css,sencha-touch,Css,Sencha Touch,我是新来的森查触摸。 如何将按钮的背景色更改为白色?我有一个按钮,每个角落有两个图像。我希望按钮是纯白色的。 我试着像这样使用css: .quest { background: url(../images/quest.jpg) no-repeat left, url(../images/rightarrow.jpg) no-repeat right; background-color: white; border: none; border
.quest {
background: url(../images/quest.jpg) no-repeat left,
url(../images/rightarrow.jpg) no-repeat right;
background-color: white;
border: none;
border-color:white;
padding-left: 50px;
text-align: left;
}
我的按钮在这里:
{
xtype: 'button',
text: '<div class="quest">Info</div>',
labelWidth: '100%',
name: '',
handler: function() {
}
}
这将呈现所需的按钮:)
正如Thiem Nguyen所说,这将起作用
{
xtype:'button',
text:'text',
ui:'plain',
style:'background-color:white'
}
使用“cls”属性解决了我的问题
{
xtype: 'button',
cls: 'btn',
text: '<div class="person">People</div>',
labelWidth: '100%',
},
我们必须重新定义背景颜色和背景图像属性,以便覆盖默认的sencha-touch.css属性。谢谢Thiem Nguyen的帮助。谢谢。但是我已经提到我也用过这个。它不起作用。你试过
ui:'plain'
了吗?我刚刚尝试用这些配置创建一个按钮,效果很好{xtype:'button',config:{ui:'plain',text:'Your text',style:'background color:white;'}}我试过这样做。你是说你想让按钮是纯白色的吗?那它看起来是什么样子?很奇怪。让我们在线查看。请转到sencha touch 2文档,并找到Ext.Panel。这是一个实时代码编辑器,我唯一更改的是:var button=Ext.create('Ext.button',{text:'button',ui:'plain',style:'background color:white;color:red;'})代码>。你得到了什么?做得很好!!唯一的问题是我们失去了被压迫的cls感觉。你知道怎么加进去吗?
{
xtype:'button',
text:'text',
ui:'plain',
style:'background-color:white'
}
{
xtype: 'button',
cls: 'btn',
text: '<div class="person">People</div>',
labelWidth: '100%',
},
.btn
{
background-color: white !important;
background-image: none;
}