在asp.net中使用母版页面来访问CSS [英] attatch css with master page in asp.net

查看:114
本文介绍了在asp.net中使用母版页面来访问CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net的母版页中使用CSS模板?请告诉我它的过程

How can I use css template with master page in asp.net?? please tell me its procedure

推荐答案

Hi,check the codee
<div id="container"> <div id="center" class="column"> <div class="code">

<%@ Master Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
 <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
 </asp:contentplaceholder>
</div>

    </form>
</body>
</html>

check the bold part of the code for adding css in master page
</div> </div> </div>


在我们的网站中使用CSS 非常容易,您只需在您的网站中创建一个stylesheet.css文件,并将其包含在
Working with CSS in our website is quite easy, you only have to create a stylesheet.css file in your website and include under
<head> </head>

标签.

tag.

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



有关样式表的更多信息,请单击链接

http://www.w3.org/TR/html4/present/styles.html [ ^ ]
http://www.thewebseye.com/creating-a-stylesheet.htm [ ^ ]
http://meyerweb.com/eric/articles/webrev/199710.html [ ^ ]

谢谢



For more learning about stylesheet follow the links

http://www.w3.org/TR/html4/present/styles.html[^]
http://www.thewebseye.com/creating-a-stylesheet.htm[^]
http://meyerweb.com/eric/articles/webrev/199710.html[^]

Thanks


在您的网站项目上单击鼠标右键,添加Asp.NET文件夹,选择主题...",它将创建一个带有子文件夹主题"的App_Themes文件夹,在其中复制您的css文件,并在webconfig中编写以下代码:

Click right on your website project Add Asp.NET Folder, select Theme... it creates a folder App_Themes with child folder Theme, there copy your css file and in webconfig write this:

<configuration>
 <system.web>
    <compilation debug="true" targetframework="4.0" />
    <pages theme="Theme1" />
 </system.web>
</configuration>



就这样



that''s all


这篇关于在asp.net中使用母版页面来访问CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆