Change Background Color of Menu Bar

How can I change the background color of the SfMenu? I cant seem to find the CSS structure for it to change.  Also if I would like the bar to appear to the right side, should I wrap it in another div and float-right?

1 Reply 1 reply marked as answer

MK Mohan Kumar Ramasamy Syncfusion Team November 9, 2020 01:50 PM UTC

Hi Amjad, 
 
We have checked your reported query. We can achieve your requirement using CSS style. Please refer below code snippets. 
 
@page "/" 
 
@using Syncfusion.Blazor.Navigations 
 
<div style="float:right"> 
    <SfMenu Items="@MenuItems"></SfMenu> 
</div> 
 
@code { 
    public List<MenuItem> MenuItems = new List<MenuItem>{ 
        new MenuItem{ Text = "File", Items = new List<MenuItem>{ 
            new MenuItem{ Text= "Open" }, 
            new MenuItem{ Text= "Save" }, 
            new MenuItem{ Text= "Exit" }} 
    }, 
        new MenuItem{ Text = "Edit", Items = new List<MenuItem>{ 
            new MenuItem{ Text= "Cut" }, 
            new MenuItem{ Text= "Copy" }, 
            new MenuItem{ Text= "Paste" }} 
    }, 
        new MenuItem{ Text = "View", Items = new List<MenuItem>{ 
            new MenuItem{ Text = "Toolbars" }, 
            new MenuItem{ Text = "Zoom" }, 
            new MenuItem{ Text = "Full Screen" }} 
    }, 
        new MenuItem{ Text = "Tools", Items = new List<MenuItem>{ 
            new MenuItem{ Text= "Spelling & Grammar" }, 
            new MenuItem{ Text= "Customize" }, 
            new MenuItem{ Text= "Options" }} 
    }, 
        new MenuItem{ Text = "Go" }, 
        new MenuItem{ Text = "Help" } 
    }; 
} 
<style> 
    .e-menu-container ul { 
        background-color: antiquewhite; 
        color: black; 
    } 
</style> 
 
 
For your reference, we have prepared a sample based on this. Please refer below link. 
 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Mohan kumar R 


Marked as answer
Loader.
Up arrow icon