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

[Solved] vertical-align: middle item text

2 Answers 67 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eva
Top achievements
Rank 1
Eva asked on 30 Apr 2012, 03:59 PM
I have the following item in a menu.  The image is centered but the text appears aligned to the top.  I have added the HTML Attribute of vertical-align: middle to no avail.  I feel like this should be really simple, so what am I missing?
@{Html.Telerik().Menu()
.Name("RibbonBar")
.Items(menu =>
{
    menu.Add().Text("Standard Sets").HtmlAttributes(new { style = "vertical-align: middle;" })
        .ImageUrl("~/Content/Common/Images/Icons/office_folders.png")
        .ImageHtmlAttributes(new { style = "width: 24px; height: 24px;" })
})
.Render();
}

Thank you!

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 01 May 2012, 03:25 PM
Hello Eva,

HtmlAttributes of a Menu item are applied to the item's <li> element. Setting a vertical-align style does not influence the layout of the content inside the <li>. You can set a larger line-height instead (e.g. the same as the image height).

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Eva
Top achievements
Rank 1
answered on 02 May 2012, 02:26 PM
Setting the line-height worked like a charm!  Thanks.
Tags
Menu
Asked by
Eva
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Eva
Top achievements
Rank 1
Share this question
or