ASP.NET菜单控件自动添加内嵌样式 [英] ASP.NET Menu control automatically adding inline style

查看:193
本文介绍了ASP.NET菜单控件自动添加内嵌样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS 2010和ASP.NET菜单控件添加以下内嵌样式:

I'm using VS 2010 and the ASP.NET Menu control is adding the following inline style:

style="float: left;"

我添加了以下控件的声明:

I added the following to the control's declaration:

IncludeStyleBlock="false" CssClass="myClass" style=""

没有成功。有没有窍门得到这个控制不添加造型?

without success. Is there a trick to get this control to NOT add styling?

菜单被渲染为这样的:

<div class="myMenu" style="float: left;" >
<ul id="menu" style="float: left ....

</div>

顶层股利不需要浮动。我不知道如何解决这个问题。

The top level div doesn't need to float. I'm not sure how to fix this.

推荐答案

浮动:左是什么让菜单项出现并排的一面。难道这不是你想要的?

The float:left is what is making the menu items appear side-by-side. Is this not what you want?

如果你真的想要它走了,你可以尝试修改你的CSS:

If you really want it gone, you can try modifying your css:

.myClass { float: none !important; }

这篇关于ASP.NET菜单控件自动添加内嵌样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆