如何在母版页中调用css文件 [英] how to call css file in master page

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

问题描述



我已经制作了css文件,想要在我的母版页上打电话。任何人都可以告诉wat是这样做的程序。



谢谢

younas

解决方案

添加css没有区别在主页的普通aspx页面中。



 <  < span class =code-leadattribute> html     lang   =  zh >  
< head runat = server >
< link rel = 快捷方式图标 类型 = image / x-icon href = images / favicon.ico / >
< ; asp:ContentPlaceHolder ID = head runat = server >
< / asp:ContentPlaceHolder >
< link href = CSS / style.css rel = stylesheet type = text / css / >
< / head >
< body >


在您的母版页中......

在HTML代码的HEAD部分....... 。





添加以下内容....

< link rel =stylesheethref =styles / My_Css_File.csstype =text / css/> 





其中My_Css_File。 css是包含你的Css文件路径的名称

,在这里,My_Css_File.css上面的样本在样式文件夹中


在头部添加它您的母版页



其次有一个非常简单的方法也只是从主页的head部分下的解决方案资源管理器中拖动css文件:)

hi,
i have made css file and want to call at my master page. can any one tell wat is the procedure to do this.

thanks
younas

解决方案

There is no difference for adding css either in normal aspx page for master page.

<html lang="en">
<head runat="server">    
    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />    
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
    <link href="CSS/style.css" rel="stylesheet" type="text/css" />
</head>
<body>


In your masterpage......
In the HEAD section of your HTML code........


Add the following....

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



where "My_Css_File.css" is the name including path of your Css file
and in this the sample above the My_Css_File.css is in the styles folder


add it in head section of your master page

and secondly there is a quite simple way also only drag the css file from solution explorer under then head section of your master page :)


这篇关于如何在母版页中调用css文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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