문제

how I can change font size of a Ext.Net button. I have tryed: 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

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

and set the CtCls property to your custom class

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

다른 팁

I would recommend a bit different solution.

It prunes "-small" from the CSS rule. That "-small" part depends on a Button's Scale.

Also it prunes the "!important" statement which is good to avoid as much as possible.

<!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 ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top