CSS and Masterpages

Discussion in 'ASP .Net' started by farseer, Aug 7, 2006.

  1. farseer

    farseer Guest

    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>
    farseer, Aug 7, 2006
    #1
    1. Advertising

  2. On 6 Aug 2006 17:15:22 -0700, farseer wrote:

    > 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
    Erik Funkenbusch, Aug 7, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick Wouters
    Replies:
    5
    Views:
    4,634
    Flinky Wisty Pomm
    May 8, 2006
  2. =?Utf-8?B?TWFya0F1cml0?=

    Masterpages css problems

    =?Utf-8?B?TWFya0F1cml0?=, Oct 26, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    284
    apathetic
    Oct 26, 2006
  3. Rbrt

    CSS in MasterPages

    Rbrt, Dec 3, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    812
    Scott Roberts
    Dec 5, 2007
  4. Mort Strom
    Replies:
    8
    Views:
    426
    Mort Strom
    Mar 2, 2008
  5. JohnE

    masterpages with masterpages

    JohnE, Dec 7, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    487
    Hillbilly
    Dec 8, 2009
Loading...

Share This Page