This is a migrated thread and some comments may be shown as answers.

PanelBar font size

2 Answers 35 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
WombatEd
Top achievements
Rank 1
WombatEd asked on 30 Jul 2010, 08:30 PM
[I'm a total newbie using Telerik MVC, so forgive me if this is obvious to you; I did Google it.]

My PanelBar defaults to a very small font (6 pt?), and I want to make it bigger.

For reasons that I shouldn't have to explain, I don't want to edit the Telerik .CSS files.

I've added an overriding style to my own .CSS, but it uses "!important", which where I come from, is severely frowned upon.

.t-link
{
    font-size8pt !important;
}

Does anybody know a cleaner approach, like a .FontSize("8pt") method?

2 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
Veteran
answered on 15 Sep 2010, 12:39 PM
There's an .HtmlAttribute method on PanelBar that you can put your style overrides in.   Check out some of the samples on the product page.

I use this:

 

 

    <% Html.Telerik().PanelBar()
        .Name("ShortcutMenuPanel")
        .HtmlAttributes (new { style = "padding: 10px;"})
        .Items(items =>
        {
            items.Add().Text("Shortcuts")
                .Expanded(true)
                .Content(() =>
            { %> 
            <div> <p>Content snipped</p>
            </div>
            <% });
        })
        .Render();
    %>

It wasn't obvious to me either.

Andy

0
Alex Gyoshev
Telerik team
answered on 15 Sep 2010, 12:58 PM
Hello Andy, Edward

The MVC components usually inherit their font-size from the container they are placed into. So you can, as Andy said, override their initial font size through the HtmlAttributes method, like
    .HtmlAttributes(new { style = "font-size: 12px" })

Or you can set the font-size of the page, like we did in the online examples:

    body { font-size: .75em; } 

Kind regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
PanelBar
Asked by
WombatEd
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Veteran
Alex Gyoshev
Telerik team
Share this question
or