3

I have an asp:Menu control that has four different menu items in it. Each menu item has a graphic and a text description.

<Items>
    <asp:MenuItem Text="New Authorization Form" Value="default.aspx" NavigateUrl="~/Default.aspx" ImageUrl="~/Images/TextPad.png"></asp:MenuItem>
    <asp:MenuItem Text="Manage My Forms" Value="myrequests.aspx" NavigateUrl="~/MyRequests.aspx" ImageUrl="~/Images/Pencil.png"></asp:MenuItem>
</Items>

My problem is the icon and text have no padding between them and it just looks ugly! Does anyone know how I can force a bit of padding between the image and text of the menu item? I've looked at all of the attributes on the asp:Menu control, but I haven't been able to find one for this, but I may have just missed it.

Jagd
  • 7,169
  • 22
  • 74
  • 107
  • u can style every menu item and Image itself. look >>> http://stackoverflow.com/questions/6390113/aspmenuitem-css – Cracker0dks Mar 07 '13 at 09:30

3 Answers3

5

I came up with an answer, but it's not what I was hoping for exactly. I added a style for img tags to my css like so:

img
{
    padding-right: 5px;
}

I'm still a little bummed that there are no attributes within the asp:Menu control that allow you to specify the padding between the image and menu item text.

Jagd
  • 7,169
  • 22
  • 74
  • 107
0

the image item in the Menu is controlled by the class icon, modifying the properties of this class should solve the problem. I set padding-right to 5px to space image and text

Nelson
  • 1
  • 1
0

you could try creating a skin and then you could add a css class to and style it any way you want

Joseph
  • 25,330
  • 8
  • 76
  • 125
  • I gave it a try, but it just increases the padding around the menu itself. Thanks for the suggestion though. :( – Jagd May 07 '09 at 18:50
  • Yeah I tried it myself and it didn't do what I was thinking it would do. – Joseph May 07 '09 at 18:51
  • I suspect that way would work too. I'll give it a go here in a bit to see if it works. – Jagd May 07 '09 at 19:38