|
-
Aug 20th, 2011, 08:25 PM
#1
Thread Starter
PowerPoster
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:
<%@ 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,
-
Aug 22nd, 2011, 01:21 AM
#2
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.
-
Aug 22nd, 2011, 09:23 AM
#3
Thread Starter
PowerPoster
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.
-
Aug 22nd, 2011, 12:11 PM
#4
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?
-
Aug 22nd, 2011, 02:50 PM
#5
Thread Starter
PowerPoster
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,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|