How do you put a gradient background on ASP.NET menu items?

The boss wants the master page's menu to look nicer. I generated my gradient file with one of the tools available on the net, no problem there.. I tried to make a CSS class for each menu item but when I use the background-image directive and the style builder, I get a line like: background-image: url('file:///C:/Documents and Settings/Username/My Documents/Visual Studio 2008/WebSites/ThisSite/Images/Gradient.png') ...when what I *want* is background-image: url('~/Images/Gradient.png') The first url will, of course, only work when I'm debugging on my local machine - deploy this and I'm hosed. So many other ASP.NET objects work with "~/" to indicate the top-level directory of the website but my css file doesn't like it and I can't set a background image for the menu control or the menu items - seems like a GLARING omission when I can do it to so many other controls. What am I missing?
I think your question title does not reflect what you are really asking. What you want to know is how to stop the style builder from putting absolute file paths on the url property, isn't it?

以上就是How do you put a gradient background on ASP.NET menu items?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏