如何在c#web表单应用程序中添加外部css文件 [英] How can I add an external css file in c# web form application
本文介绍了如何在c#web表单应用程序中添加外部css文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用c#为Web应用程序设计UI。但是我不知道如何在c#web表单应用程序中添加外部css文件。
请把你的答案详细说明..
在此先感谢..
解决方案
hi,
1.Right点击您的网站/ wepapplication in解决方案资源管理器。
2.单击添加 - >新项目,选择样式表
现在,css文件已添加到您的解决方案中。
3.在此StyleSheet.css中写入CSS并保存。
4.在标签内的aspx页面中包含StyleSheet.css文件。
< pre lang =xml> < head runat = server < span class =code-keyword>>
< title > 主页< / title >
< link rel = stylesheet 类型 = text / css href = StyleSheet.css / >
< / head >
参考:如何:将层叠样式表链接到ASP.NET网页(Visual Studio) [ ^ ]
I want to design a UI for web application using c#. but I dont know How can I add an external css file in c# web form application.
Please put your answer with details..
Thanks in advance..
解决方案
hi,
1.Right Click on your website/wepapplication in solution explorer.
2.Click on Add->New Item, Select "Style Sheet"
Now a css file is added to your solution.
3.Write your CSS in this "StyleSheet.css" and Save.
4.Include the StyleSheet.css file in your aspx page inside tag.
<head runat="server"> <title>Home</title> <link rel="stylesheet" type="text/css" href="StyleSheet.css" /> </head>
Refer: How to: Link Cascading Style Sheets to ASP.NET Web Pages (Visual Studio)[^]
这篇关于如何在c#web表单应用程序中添加外部css文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文