Style Sheet Not Being Used

Permalink
I'm making a custom theme for a website I've been asked to design, and when I activate it all I get is black text on a white background. Everything is still there; but it's not styled. No background images, no color, not anything.

I've tried just about everything, both in the PHP and the stylesheet. I've been searching on Google and on these forums for about 5 hours now and I'm stumped.

I'm running this in WAMP on localhost, so I can't provide a link unfortunately.

I'm pretty new to concrete5, so I apologize if this is something that get's brought up too often; however, I'm obviously missing something here and any help would be much appreciated.

 
VidalThemes replied on at Permalink Reply
VidalThemes
Hi There,

It sounds like a path issue to me, are you calling your style sheet like this:

<link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('style.css')?>" />


Also your style sheet should be in the root of your theme, I would advise against, placing it in a folder, so instead of:

/css/my_style_sheet.css

Just go with:

/my_style_sheet.css

If none of that helps, maybe post the code you are using, as you cant link to a site, just stick your code in between the code tags and let someone have a look at your code.

Regards
rbailey5 replied on at Permalink Reply
Thanks for the response

Currently I've got it set up like this.
<link href="<?php echo $this->getStyleSheet('main.css')?>" media="screen,projection" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->getStyleSheet('typography.css')?>" media="screen,projection" rel="stylesheet" type="text/css" />

however, I had it like this before I split it into two files
<link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('style.css')?>" />

I tried it like this as well.
<link href="<?=$this->getThemePath()?>/style.css" rel="stylesheet" type="text/css" />

My .css files are in the root of my theme.
VidalThemes replied on at Permalink Reply
VidalThemes
Hi, Can you post the entire page? it may be a problem further up/down.
rbailey5 replied on at Permalink Reply
Thanks for your help
Here's the entire page
<!DOCTYPE html>
<html>
   <head>
      <?php Loader::element('header_required'); ?>
         <link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
         <link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" />      <link href="<?php echo $this->getStyleSheet('typography.css')?>" media="screen,projection" rel="stylesheet" type="text/css" />
   </head>
   <body>
      <div id="wrapper">
         <div id="banner">

</div>
         <div id="navbar">
            <ul>
               <?php
                  $a = new Area('NavTop');
                  $a->display($c);
               ?>            
            </ul>
         </div>
         <div id="comtemt">
            <?php
               $a = new Area('Main');
               $a->display($c);
            ?>            
         </div>

<div id="footer">
            <p>Copyright © 2011. All Rights Reserved.</p>
         </div>
      </div>
         <?php 
            Loader::element('footer_required'); 
         ?>
   </body>
</html>
VidalThemes replied on at Permalink Reply
VidalThemes
Hi There,

Ok, I just slipped your code into my base theme, exactly as it is, changed my style sheet name to main.css, and hey presto it worked fine. so your code seems to be fine and the paths are ok. so there may be other stuff going on.

Its a shame its not on a live server as I could take a deeper look for you. it could be that WAMP is not quite playing ball, have you tried setting up a XAMPP install and seeing if the results are the same?

May be worth a shot.
rbailey5 replied on at Permalink Reply
I'll try that right now.
rbailey5 replied on at Permalink Reply
Still nothing.

Is there something in my css that could be causing this.

Here's my "main.css"
body {
   background-color:#1e3c1e;
}
#wrapper { 
   width:800px;
   margin:0px auto;
   border-radius:20px;
   box-shadow: 0px 0px 7px black;
   background-color:#fafafa;
}
#banner {
   margin:0px;
   height:100px;
   border-top-left-radius:20px;
   border-top-right-radius:20px;
VidalThemes replied on at Permalink Reply
VidalThemes
Hi there

The only thing I can pick up there, is that your content Id is in your HTML as "comtemt" but in your CSS the Id is spelt correctly as "content" needs to be the same.
rbailey5 replied on at Permalink Reply
thanks so much for your help. Unforntunately nothing seems to be working
VidalThemes replied on at Permalink Reply
VidalThemes
If you get round to putting it on a live server, shoot me a PM with the FTP details and I will gladly check it out for you. Sorry I couldn't be of more help.
jero replied on at Permalink Reply
jero
Unless you are planning to make your style sheet user editable, there is no value in using getStyleSheet(), and it actually slows things down doing so, because the style sheet is parsed on every page view.

I tend to use

<link href="<?php echo $this->getThemePath()?>/style.css" rel="stylesheet" type="text/css" />


Note the use of the full <?php tag, and the echo syntax.

One thing that might we worth doing is looking at the source code of the page that's being output. Does it contain a valid path to the stylesheet you want to use? If it does, what happens when you put that URL into your browser?

The above code sample expects the CSS file to be in the root of your theme, not in a css subfolder, i.e. it's in the same folder as your templates.
rbailey5 replied on at Permalink Reply
And now it works!

Thanks Vidall and jero for your time and assistance.