web developer tips (68):附加样式表到网页

原文地址:How simple it is to attach an existing style sheet to your web page?

在Visual Studio 2008里打开已经建好的网站,在解决方案管理器里,双击打开想附加样式表(css)的网页。
切换到设计视图,通过菜单:格式+附加样式表,打开“选择样式表”对话框。
Attach StyleSheet
http://www.watch-life.net/visual-studio/how-simple-it-is-to-attach-an-existing-style-sheet-to-your-web-page.html

在对话框选中需要附加的样式文件,单击“确定”,你就可以在页面来使用这个样式表文件了。在源视图会产生如下代码:

<head runat="server">

<title>Untitled Page</title>

<link href="StyleSheet.css" rel="stylesheet" type="text/css" />

</head>

或者你也可以切换到需要附加的页面,然后在解决方案管理器里拖拽一个样式表到这个页面。同样的,也会在页面的源视图也会添加上面的代码。

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

posted on 2009-11-26 09:25  xjb  阅读(337)  评论(0编辑  收藏  举报

导航