开发者

VS2008 Not Automatically Creating Style Class For Absolute-Positioned Elements

In www.asp.net tutorials #4 "Page Layout", Joe Stagner changes positioning of elements to Absolute and drags them to a new location. Visual Studio renders this in HTML with a new CSS class in a new section. When I duplicate the steps, I get inline CSS style instead, in the form of

<asp:Button ID="Button1" runat="server" CssClass="style1" 
  style="z-index: 1; position: absolute; top: 150px; left: 302px" Text="Button" />

There is no "style1" class created, and in fact no style element created either.

In VSTS 2008 Tools|Options|Html Designer|CSS, all 6 choices are "CSS(classes)", and in Tools开发者_如何转开发|Options|Html Designer|CSS Styling, "auto style application" is selected, as well as 1st, 4th, and 5th options checked.

How do I tell Visual Studio 2008 to generate style classes, rather than inline styles?


Solved this by enabling the "Style Application" toolbar, changing the mode to Manual, and setting the Target Rule to (New Auto Class). This is the desired behavior described in the question, and I think it was probably the default behavior. No idea why it stopped working, except maybe I broke it when poking around in all the menus.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜