CSS and Masterpages

F

farseer

Hello,
i have the following stylesheet named Master.css with content as
follows:

body
{
font-family: Tahoma,sans-serif;
font-size: 150%;
background-color:Yellow;

}

When i include this in my master page as such:

<head runat="server">
<link rel="StyleSheet" href="Master.css" type="text/css">
</head>

I do not see the styles being effected on my master page. However, if
i were to directly specify the styling in the master page it self using
the html below, it does. Why does one work and not the other.

<STYLE TYPE="text/css" MEDIA=screen>
body
{
font-family: Tahoma,sans-serif;
font-size: 150%;
background-color:Red;

}
</STYLE>
 
E

Erik Funkenbusch

When i include this in my master page as such:

<head runat="server">
<link rel="StyleSheet" href="Master.css" type="text/css">
</head>

I do not see the styles being effected on my master page. However, if
i were to directly specify the styling in the master page it self using
the html below, it does. Why does one work and not the other.

The css has to be accessible relative to the content page, not the master
page. That means that if your master page is at /master/master.master and
your css is at /master/master.css and your content page is at
/default.aspx, then your link href has to point to /master/master.css
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top