Results 1 to 5 of 5

Thread: Content Pages not recognizing Stylesheet

  1. #1
    PowerPoster
    Join Date
    Jan 04
    Posts
    3,616

    Content Pages not recognizing Stylesheet

    I have a web app that utilizes a masterpage and several content pages. I have my StyleSheet.css inside my MasterPage, however, the content pages aren't picking up the styles. Below is my MasterPage markup.



    Code:
    <&#37;@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.vb" Inherits="PF.Site1" MasterPageFile="" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
           <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder>
           <link href="Styles/StyleSheet1.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
    </body>
    What am I doing wrong?

    Thanks,
    Blake

  2. #2
    Frenzied Member
    Join Date
    Apr 09
    Location
    CA, USA
    Posts
    1,500

    Re: Content Pages not recognizing Stylesheet

    You've referred to your stylesheet using a relative path; make sure that this path is relative to the content pages, or change it to an absolute path.

  3. #3
    PowerPoster
    Join Date
    Jan 04
    Posts
    3,616

    Re: Content Pages not recognizing Stylesheet

    The "Styles" directory is in the same root directory as my ContentPages. I guess I'm not sure how to do what your stating.
    Blake

  4. #4
    Frenzied Member
    Join Date
    Apr 09
    Location
    CA, USA
    Posts
    1,500

    Re: Content Pages not recognizing Stylesheet

    A relative path (a path that doesn't start with /) signifies that the file should be found by following the path starting from the same directory as the current file. So for a content page to find the stylesheet file, then the "Styles" directory needs to be in the same directory as the content page file. But it sounds like you've already got this set up correctly. You could still troubleshoot by loading up the Developer tools in IE and then clicking on the CSS tab - there's a drop down with selections for each linked CSS file on the page; if you select your CSS file and it doesn't show any content, you have a path problem.

    Is it possible that the style rules in your stylesheet are inapplicable to any elements on the content page?

  5. #5
    PowerPoster
    Join Date
    Jan 04
    Posts
    3,616

    Re: Content Pages not recognizing Stylesheet

    Sam,

    I did what you suggested and everything checks out in IE's Developer Tools. I might add that this just recently became a problem. Originally, it worked fine....so obviously I've done something different, I just don't know what.

    Thanks,
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •