1

I'm familiar with php,css but I'm newbie too asp.net. I'm learning asp.net I want to write css for asp form. How to create it link to the page. I tried to create label and textbox for login page. I have css for my button. Now to create separate page for css. How to do it in asp.net.

.test {
-moz-box-shadow:inset 0px 1px 3px 0px #91b8b3;
-webkit-box-shadow:inset 0px 1px 3px 0px #91b8b3;
box-shadow:inset 0px 1px 3px 0px #91b8b3;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #768d87), color-stop(1, #6c7c7c));
background:-moz-linear-gradient(top, #768d87 5%, #6c7c7c 100%);
background:-webkit-linear-gradient(top, #768d87 5%, #6c7c7c 100%);
background:-o-linear-gradient(top, #768d87 5%, #6c7c7c 100%);
background:-ms-linear-gradient(top, #768d87 5%, #6c7c7c 100%);
background:linear-gradient(to bottom, #768d87 5%, #6c7c7c 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#768d87', endColorstr='#6c7c7c',GradientType=0);
background-color:#768d87;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
border:1px solid #566963;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:11px 23px;
text-decoration:none;
text-shadow:0px -1px 0px #2b665e;
}
 .test:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #6c7c7c), color-stop(1, #768d87));
background:-moz-linear-gradient(top, #6c7c7c 5%, #768d87 100%);
background:-webkit-linear-gradient(top, #6c7c7c 5%, #768d87 100%);
background:-o-linear-gradient(top, #6c7c7c 5%, #768d87 100%);
background:-ms-linear-gradient(top, #6c7c7c 5%, #768d87 100%);
background:linear-gradient(to bottom, #6c7c7c 5%, #768d87 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#6c7c7c', endColorstr='#768d87',GradientType=0);
background-color:#6c7c7c;
}
 .test:active {
position:relative;
top:1px;
}

3 Answers 3

2

In visual studio right click in your project in the solution explorer. then add new item. In the dialogue you can get CSS file. Choose CSS item, give a name and write your css code in the created file.

open your a expected .aspx page, put the cursor where to place the css file reference and just drag the CSS file and drop it in .aspx html code. reference to your css file will automatically be created in the page. or you can write

<link rel="stylesheet" type="text/css" href="~/path/yourcss.css"> to refer. 

Also in the master page just refer your css file link and inherit that master page to your expected page.

Thanks.

Sign up to request clarification or add additional context in comments.

Comments

1

What IDE are you using? It's Visual Studio? If so:

Click right mouse button on project or folder in Solution Explorer, choose add new item, select Web category (tree on the left) and select Style Sheet.

After that add to asp page line with link rel.

Comments

1

Please save your css file with ".css" extension and you can add external css file in asp .net page with:

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

2 Comments

My problem is I dont know hoe to create css file in asp.net
Right click on your project solution you will got a add item

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.