---
title: "web developer tips (2):样式应用工具栏的工作模式"
author: "cjc"
date: "2009-05-25T01:07:00Z"
tags: []
slug: "web-developer-tips-2"
draft: false
lastmod: "2009-05-25T01:07:00Z"
id: 402628
url: "https://cjc.iteye.com/blog/402628"
---

&lt;script&gt;function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}&lt;/script&gt;

原文链接：[The Style Application Toolbar works in both Auto and Manual modes](http://blogs.msdn.com/webdevelopertips/archive/2008/07/29/did-you-know-the-style-application-toolbar-works-in-both-auto-and-manual-modes-tip-2.aspx)

“**样式应用工具栏**”使你可以自动创建和修改样式，这个工具窗口有自动和手动两种工作模式。

“自动模式”是针对不熟悉CSS的用户， Visual Studio将控制新生成的样式放置位置。  
“手工模式”是针对有经验的用户，手动模式下用户可以通过目标规则来控制样式放置位置，目标规则在一个下拉框里显示：类名（当前页），新建自动类，新建级联样式，应用新样式  
![The Style Application Toolbar](http://p.blog.csdn.net/images/p_blog_csdn_net/honker110/EntryImages/20090109/Style%20Application_thumb_1.jpg)

**类名（当前页）**：所有的样式格式工具条来创建在类里（当前页），比如粗体，颜色等。  
**新建自动类**:在这种情况下，新的样式将被命名为style1 ， style2 ，并将放置在当前页的样式代码段里。  
**新建级联样式**：顾名思义，所有被选中的控件新样式都将被放在级联样式里。  
**应用新样式**：使用样式创建的对话框来创建一个新的样式。

样式应用工具栏是 Visual Studio 2008中管理页面样式一个很方便的工具，配合[CSS样式工具窗口](http://www.watch-life.net/visual-studio/powerful-css-tools-to-create-manage-and-apply-styles.html)（应用样式Apply Styles 、管理样式Manage Styles、CSS属性CSS Properties），对于开发[Asp.net](http://www.watch-life.net/category/aspnet)的前台页面的程序员来说绝对是利器。

更多文章见：[守望轩](http://www.watch-life.net)\[[http://www.watch-life.net](http://www.watch-life.net)/]