如何从母版页应用内容页面css [英] how to apply content page css from master page

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

问题描述

大家好,





asp .net的新面孔。现在我创建一个母版页和内容页面。内容页面显示在contentplaceholder。但是css不适用于内容页面。我试试这个



在Master Page



< / head>

Hi all,


Am very new face for asp .net. Now i create one master page and content page. Content page displayed at contentplaceholder. But css is not apply for content page. Am try this one

At Master Page

</head>

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

   <asp:ContentPlaceHolder id="head" runat="server">

   </asp:ContentPlaceHolder>





在内容页面





At Content Page

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <link href="../css/career.css" rel="stylesheet" type="text/css" media="screen" runat="server"  />
<div id="whole">











欢迎所有回复....





谢谢和问候,



Dhineshkumar Velmayil。






All replies are welcome....


Thanks and Regards,

Dhineshkumar Velmayil.

推荐答案

您的Web目录结构是什么?请提供Project Explorer的屏幕截图。
What's Your Web Directory Structure? Please Provide a Screenshot of Your Project Explorer.


在母版页中,您需要提供您的css文件链接



In master page you need to provide your css file link

<head id="Head1" runat="server">
  <link href="Styles/MainPage.css" rel="stylesheet" type="text/css" />

<body>









然后你可以在aspx页面中轻松使用你的css属性。





Then you can easily use your css properties in aspx pages.


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

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