Click here to Skip to main content
15,898,766 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Comments
Sergey Alexandrovich Kryukov 2-Dec-12 0:48am    
Call a file? What is it? :-)
--SA

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

HTML
<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>
 
Share this answer
 
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
 
Share this answer
 
Comments
Rockstar_ 3-Dec-12 0:21am    
Exactly...........
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 :)
 
Share this answer
 
hi
just drag your css file and put in to head tag.

it will create link tag.
 
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