简体   繁体   English

Ext.Net按钮改变字体大小

[英]Ext.Net button change font size

how I can change font size of a Ext.Net button. 如何更改Ext.Net按钮的字体大小。 I have tryed: Css: 我试过:Css:

.x-16
{
    font-size: 16px;
}

Razor: 剃刀:

X.Button().Icon(Icon.PluginAdd).ID("NewTask").Text("New Task").Handler("Myapp.ShowWinAddTask").Cls("x-16")

Any ideas? 有任何想法吗?

You need to modify the CSS declaration to this 您需要修改CSS声明

.x-16 .x-btn-default-small .x-btn-inner
{
    font-size: 16px !important;
}

and set the CtCls property to your custom class 并将CtCls属性设置为您的自定义类

X.Button().CtCls="x-16"

I would recommend a bit different solution. 我会推荐一些不同的解决方案。

It prunes "-small" from the CSS rule. 它修剪CSS规则中的“-small”。 That "-small" part depends on a Button's Scale. “-small”部分依赖于Button的Scale。

Also it prunes the "!important" statement which is good to avoid as much as possible. 它还修剪了“!important”语句,尽可能避免这种说法。

<!DOCTYPE html>
<html>
<head>
    <title>Ext.Net.MVC v2 Example</title>    

    <style>
        .x-16 .x-btn-inner {
            font-size: 16px;
        }
    </style>
</head>
<body>
    @Html.X().ResourceManager()

    @Html.X().Button().Text("Button").Cls("x-16")
</body>
</html>

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

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