Ø You
can edit all your pages easier & reuse your CSS.
Ø Your
page can load faster & easier.
Ø Save
Space as well as Time.
Ø External
style sheets keep your website design & content separate.
Applying
CSS to asp.net web application
Applying CSS is easy,
Firstly Add new Folder-àGive Name AS (CSS)
1)Right
Click on CSS Folder---à2)Add New Item--à
3)new
wizard open(Add New Item)--àStyle Sheet.css--à4)ok ,as show below
Now copy and
paste the .CSS Content, example
/*To apply to following
style to
all Paragraph
Tag.*/
p
{
color:Purple;
font-size:xx-large;
font-family:Bookman Old Style;
background-color:Lime;
}
/*To apply to following
style to
all Heading1
Tag.*/
h1
{
color:Green;
background-color:Silver;
font-family:Comic Sans MS;
}
/*Let say, I want to apply a specific style to Paragraph Tag
to some
Page3 in
my Web
Application, you
can do
this using
"class" attribute of
Paragraph Tag,
here you
need to
apply <p
class="pForMyPage3">.*/
.pDefaultPage3
{
color:Gray;
font-size:xx-large;
font-family:Arial;
background-color:Yellow;
}
/*for button */
.TestStyle1
{
font: 12pt verdana;
font-weight:700;
color:orange;
}
.TestStyle2
{
font: 12pt verdana;
font-weight:900;
color:Maroon;
}
Step2: Adding content to .CSS File
Step
3: Adding .CSS File Link into .aspx Page
See below figure for knowing how to apply CSS
to control and adding link tagS.
OUTPUT:-
|