Hello!

I have problem with css on a new theme im creating, ive done the theme basics and set it as default theme, so far so good. Then i started to add some css to the site and its showing nothing of the css. When i load the css file on Firefox web developing tools its working as intented but when i save the file and reopen the site normally it doesnt show any of the css ive done.

Heres my info file:

name= Kjl
description= Kjl-theme
core= 7.x
engine= phptemplate

stylesheets [all][]= template.css

regions[header]= Header
regions[navigation]= Navigation
regions[content]= Content
regions[sidebar_let]= Sidebar Left
regions[sidebar_right]= Sidebar Right
regions[footer]= Footer
regions[help]= Help

And the css ive done so far, its on file named template.css thats is in the theme folder:

.header-wrap,
.navigation-wrap,
.body-wrap,
.footer-wrap {float:left;width:100%;}

.header,
.navigation,
.body,
.footer {width:960px;margin:0 auto;}

.header-wrap {height:118px;background:url(/sites/all/themes/kjl/files/bg-header.png) repeat-x;}

I know im missing something, just cant figure out what. If anyone could help me with this I`d really appreciate it.

Comments

vm’s picture

when you view the rendered source is the template.css file being printed in the head of the document?

Also of note: you path in your css file should be relative. /sites/all/themes/kjl/ isn't needed

Maiskis’s picture

when you view the rendered source is the template.css file being printed in the head of the document?

No, it seems to be pulling css from localhost files. Shows in the code like this:

style type="text/css" media="all" @import url("http://localhost/drupal/modules/system/system.base.css?mrj011")

Im using Wamp local host to create and test the theme. Should i replace the code in the head somehow or is it some setting that is doing this?

Thanks for your help.

vm’s picture

when you last altered the .info file did you reset the theme registry by clearing the database cache tables?

Maiskis’s picture

Yes, I pressed "clear all caches".

Maiskis’s picture

Is there a way to alter the code so that it will pick up the right css file or is it some setting that keeps doing this?

vm’s picture

change template.css to custom.css
change the definition in your theme .info
clear cache

is the custom.css file rendered in the head?

Maiskis’s picture

No, its still pulling the same files from the local host directory.

vm’s picture

if the site is on your local machine it will pull from localhost. Thefore I suppose the question should be asked. Is this site on your local machine? or on a host? If the latter, did you alter .htaccess or settingh.php in any way?

Maiskis’s picture

The site is on my local machine. Im a total newbie on this so I`ve just followed the instructions to install wamp server and drupal.

I can choose the theme on drupal and its showing all the regions ive created correctly, css is the only problem ive encountered so far.

vm’s picture

if it's on your local machine then localhost being in the path is correct.

What you need to look for in the head of your document is: http://localhost/drupal/sites/all/themes/YOURTHEME/YOURCSS.css

else copy the head of your document and paste it to pastebin.org and link it here.

Also, if you switch to a core theme does CSS show?

Maiskis’s picture

The head is showing different path, its leading to /drupal/modules to pick up the css. Changing the theme back to Bartik doesnt "fix" this, its still picking up the same css file.

Heres the link to see what the head looks like: http://pastebin.com/iMkeG0Sn

Maiskis’s picture

Changing the theme doesnt change anything in the head, it stays excatly the same.

vm’s picture

The head is showing different path, its leading to /drupal/modules to pick up the css

It is supposed to as that is where the core .css files are located. At this point, I can't explain why your theme .css files (whether template.css in your custom theme, or style.css in bartik) are being called.

I suggest testing a new install. if nothing else, a core theme should be using a style.css in the head.