link to style sheets

Discussion in 'ASP.NET 2.0' started by NewMind, Oct 3, 2006.

  1. I can't get my style sheets to register. I use:
    <link id="HeaderStyle" type="text/css" href="e:\web\xxx\htdocs\UI\css\xxx.css" rel="stylesheet"/>
    All I get is a page with NO styles applied
     
  2. For your path don't include the actual file path, just the web root path.


    If you're using Visual Studio drag the Style Sheet over onto the document and look at the path it creates.
     
  3. The <link />tag is a client side tag. Because this is interpreted by the browser and not your server, it will ony have access to files web browsers have access to. So you will not be able to use any local paths with this tag.





    You can also use relative paths such as this...





    <link id="HeaderStyle" type="text/css" href="/UI/css/xxx.css" rel="stylesheet"/>



    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     

Share This Page