You are here:   Articles
  |  Login

Programming Articles

Minimize
15

The Asp.net menu control adds font-size:1em to the menu items.

This prevents setting the font-size in a CSS style sheet. That is a nuisance.

The quickest way to override this problem is by using the !imporant modifier in your CSS style sheet like this.

a.my_menu_style 
{ font-size:2em !important; }

To gain more control over the HTML that Asp.net controls output, see this page Asp.Net 2.0 CSS Friendly Control Adapters.

Posted in: Asp.net

Post Rating

Comments

Slavik Derevyanko
# Slavik Derevyanko
Friday, September 02, 2011 2:58 PM
Confirmed.

This happens to me with .net4
on trying to use System.Web.UI.WebControls.TreeView
and setting TreeView.NodeStyle.CssClass.

That generates inline style attribute
style="border-bottom-style: none; border-right-style: none; border-top-style: none; font-size: 1em; border-left-style: none;"


Post Comment

Only registered users may post comments.

Programmer Newsletter

Minimize

Subscribe to the Internet Handholding newsletter



Reccomend Programmer.bz

Minimize

Share/Bookmark Bookmark and Share