Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I use css template with master page in asp.net?? please tell me its procedure
Posted

XML
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>
 
Share this answer
 
Working with CSS in our website is quite easy, you only have to create a stylesheet.css file in your website and include under
HTML
<head> </head>
tag.

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


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
 
Share this answer
 
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:

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


that's all
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900