开发者

ASP.NET Menu control automatically adding inline style

开发者 https://www.devze.com 2023-04-02 02:04 出处:网络
I\'m using VS 2010 and the ASP.NET Me开发者_StackOverflownu control is adding the following inline style:

I'm using VS 2010 and the ASP.NET Me开发者_StackOverflownu 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?


The menu is rendering as such:

<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?

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

.myClass { float: none !important; }


Using inline styles overwrites behaviour of other css defined styles. The solution that I used was jQuery:

$("<DIV> id").removeAttr("style");
$("<UL> class").removeAttr("style");
$("<UL> class").find("li").removeAttr("style");

Regards!

0

精彩评论

暂无评论...
验证码 换一张
取 消