Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET CSS
hai sir,this is voijaya durga.I am doing realtime project. how to add css file to asp.net project please send the quick reply sir
Posted 29-Nov-11 18:38pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Add CSS in project:
In SolutionExplorer --> Right click o project --> Add existing item and select Stylesheet(CSS).
 
Use CSS in ASPX page:
You need add refererence of CSS file in ASPX page
<link href="Stylesheet.css" rel="stylesheet" type="text/css" />
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

to add new css file..
 
right click on your project - Add new item - select stylesheet - click Ok
 
to add existing .css file..
 
right click on your project - Add existing item - browse for file - click Ok
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Hi Prince,
to add new css file..
 
right click on your project - Add new item - select stylesheet - click Ok
 
to add existing .css file..
 
write like this
.body
{
    background: #b6b7bc;
    font-size: .80em;
    font-family: "Helvetica Neue" , "Lucida Grande" , "Segoe UI" , Arial, Helvetica, Verdana, sans-serif;
    margin: 0px;
    padding: 0px;
    color: #696969;
}
and in aspx page you can refere
<link href="CSS/StyleSheet.css" rel="stylesheet" type="text/css" />
Tank U.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

HI ,
the solution to your question is below:
 
First Open Your "MasterPage"-> add the selected Css page in master page->
Drag and drop css below header file->then go to downloaded css template and open that template -> right click on the template and click the option "view page source" -> copy the template body code-> open the master page -> paste the template body code within the body of master page.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

<pre lang="Javascript">
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 8

First you have to add your css to your project hierarchy...
good way to do that is to create a separate folder for example named as style in project hierarchy and add your css file in that.. either by right click and add existing item. or by opening project in window file explorer and pasting your file there in desired folder.
 

anyways after when you have css file in your project hierarchy.. you can use it on the specific page where you want by adding reference like below.
 

<link type="text/css" rel="stylesheet" href="Folder hierarchy/cssfilename" />
 

NOTE.... gud way to reach your desired css file in href tag is to just leave the cursor after putting first quote there.. you will be seeing a "Pick URL" option.. and you can use that to reach your css widout any mistake.
 

Hope it will help.
 
Smile | :)
  Permalink  
Comments
CHill60 at 13-Jun-13 8:49am
   
Hi - it's good that you want to help but this post is over a year old and already has 7 solutions posted. Just to let you know, posting solutions to old, answered questions often attracts downvotes.
Khan Ji at 13-Jun-13 8:54am
   
and btw thanks alot for downvoting it... !!!
CHill60 at 13-Jun-13 9:00am
   
That wasn't me. It was already downvoted when I got here which is why I looked
Khan Ji at 14-Jun-13 1:21am
   
okay fine.. but whoever down voted it,, should share the reason of that as well....
Khan Ji at 13-Jun-13 8:52am
   
Ya.. i know that.. but have you seen the same question's Solution NO.04 being edited just 2 minutes ago by "Savalia Manoj"??? and it is also showing in "UnAnswered Questions"... So i thot that might be some one needed it again.. and i just posted a answer.. Hope now ur objection will be not as before... :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 9

ADding CSS Direct in page use <Style> tag .... Like..........
 

<head runat="server">
<style type="text/css">
.class1
{
margin:0px auto;
width:990px;
}
</style>
<title></title>
</head>
<asp:Button ID="btnABC" CssClass="class1" runat="server" Text="TEST"/>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 10

for a new css file..
 
right click on your project - Add new item - select stylesheet - click Ok
 
if u have already an css file and want to add that with your projec t then go this way
 
right click on your project - Add existing item - browse for file - click Ok

for add it to your project
 
<link href="here name of your stylesheet" rel="stylesheet" type="text/css" />
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 18 Sep 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100