CSS and Masterpages

  • Thread starter Thread starter farseer
  • Start date Start date
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>
 
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
 
Back
Top