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

Menu NOT respecting styles

1 Answer 30 Views
Menu
This is a migrated thread and some comments may be shown as answers.
BishMan
Top achievements
Rank 1
BishMan asked on 23 Jul 2013, 05:18 PM

Hello,

I am creating a menu and I am trying to get the LAST item to float right,
as you can see in my code, I am setting the last item HTMLAttributes @class to float right but it is not repsecting that.

What can I do to fix it.

@(Html.Kendo().Menu().Name("Menu")
            .Items(items =>
                {
                    items.Add().Text("Clear Jobs")
                        .Items(i =>
                            {
                                int days = ViewBag.LogDetailDays;
 
                                i.Add().Text("Clear jobs created more than " + days + " days ago")
                                    .Action("Jobs_DeleteLast", "Jobs")
                                    .HtmlAttributes(new { onclick = "return confirm('Are you sure you want to clear jobs?');" });
                                i.Add().Text("Clear all jobs")
                                    .Action("Jobs_DeleteAll", "Jobs")
                                    .HtmlAttributes(new { onclick = "return confirm('Are you sure you want to clear jobs?');" });
                            });
 
                    items.Add().ImageUrl("~/Images/refresh.png")
                         .Url("~/Jobs.html")
                         .HtmlAttributes(new { onclick = "refreshGrid()",
                                               @class = "float-right",
                                               title = AdminUI.RefreshButton_Tooltip })
                                               .Url("#");
                })
    )

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 24 Jul 2013, 07:32 AM
Hello Jay,

Please make sure that the CSS rule that you are using to float the last item to the right has a high-enough specificity, so that it can override the default Kendo UI float style, which has a specificity of 0,0,3,0 (zero inline styles, zero IDs, three CSS classes, zero type selectors).

You can easily see what conflicting styles are applied to the Menu items and which ones take precedence, by using Firebug or a similar tool to inspect the Menu HTML markup and styling.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Menu
Asked by
BishMan
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or