---
title: "web developer tips (1):创建、管理、应用样式表的强大工具"
author: "cjc"
date: "2009-05-20T01:16:00Z"
tags: []
slug: "web-developer-tips-1"
draft: false
lastmod: "2009-05-20T01:16:00Z"
id: 402630
url: "https://cjc.iteye.com/blog/402630"
---

&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;

原文链接：[Powerful CSS Tools to Create, Manage and Apply Styles](http://blogs.msdn.com/webdevelopertips/archive/2008/07/23/web-tools-tip-1-powerful-css-tools-to-create-manage-and-apply-styles.aspx)

Visual Studio 2008 包含了三个新的CSS样式工具窗口：  
1、应用样式（Apply Styles ）  
2、管理样式（Manage Styles）  
3、CSS属性（CSS Properties）

在（aspx文件）设计视图，或拆分视图，或源视图 的模式中，在“视图”菜单下上述三个选项都是可用的。

**应用样式**  
使用此工具窗口，你可以创建、应用、修改样式。这个工具窗口列出了特定页面的所有样式，包括嵌入式的样式，外部样式表和当前页面的样式表。应用样式到选定的控件很简单，在应用样式窗口样式列表中选择一个样式，单击它，选择“应用样式”。  
![Apply Styles](http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/WebToolsTipoftheDay1PowerfulCSSToolstoCr_D937/Apply%20Styles_thumb_1.jpg)

**管理样式**  
使用“管理样式”窗口，可以通过从一个外部样式表文件里拖拽到当前页面，来管理样式定义的位置。  
![Manage Style](http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/WebToolsTipoftheDay1PowerfulCSSToolstoCr_D937/Manage%20Styles_thumb.jpg)

**CSS属性**  
使用此工具，你可以迅速找到某一个特定页面上的控件的被应用了那些样式，你也可以让控件的一个样式覆盖另一个样式。还可以在这里添加、删除或修改样式。  
![CSS Properties](http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/WebToolsTipoftheDay1PowerfulCSSToolstoCr_D937/CSS%20Properties_thumb.jpg)

在Visual Studio 2008里面这三个css的工具，对于前台开发的程序员来来说，特别是对CSS不是非常熟悉的程序员，比以前更加轻松地使用样式表，给前台的设计带来的极大的便利。在“设计”视图中完成布局设计、内容样式设置、更改定位、填充和边距等大部分工作。特别是在“设计”视图中所见即所得的设计方式中，不必运行启动web程序就可以马上看见css属性的应用效果。

Visual Studio 2008的css编辑器也很强大，语法高亮、自动完成、CSS代码检查，比起诸如[TopStyle](http://www.newsgator.com/Individuals/TopStyle/)、[Style Master](http://www.westciv.com/style_master/) 这样的专业CSS的编辑器一点也不逊色。不过，如果是做asp.net的开发，vs2008的css编辑器当然是首选。

相关资源：  
1、[CSS Editors Reviewed](http://www.smashingmagazine.com/2008/06/19/css-editors-reviewed/)  
2、[Visual Studio 2008 中的新增功能](http://msdn.microsoft.com/zh-cn/library/bb386063.aspx)

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