By jp667 on
Hi,
I'm quite new to Drupal and I'm trying to understand themes. I've downloaded the Zen theme and i have created a sub-theme but I don't understand why there are so many stylesheets. I have looked at a tutorial which all used older Zen versions and there were not a lot of stylesheets. But my sub theme has its own folder filled with them. So if I'm editing the theme which stylesheet do I edit?
I have read through all the documentations but its not really clear as to what is what. I'm not sure if I have installed it correctly but I have done everything that the doco says. But all the older versions of Zen don't have all the stylesheets in the sub theme, why is it different now?
Thanks.
Comments
Try This
You can create your css file, go to your css folder from theme( STARTERKIT ) and add your css file as theme.css and now add css to that file,
I tried it, I created the new
I tried it, I created the new .css file and added it into the .info file but it doesnt seem to be making any changes.
What Im trying to do is increase the width of the navigation bar up the top below the header so I can put in my own navbar Image file and so that the primary link actually fit there. at the moment the title of the menu is sitting below the main content of the site.
http://i220.photobucket.com/albums/dd201/jonas612/Screenshot-1.png
Notice the top left where catagory is nearly gone. I tried going into the layout-fixed.css and increasing the width but it just got worse, I also tried doing so in the navigation.css.
Is it not possible to increase the size of regions in the zen theme?
1. Try this code in your css
1. Try this code in your css file
and go to My account. And see if there is red background. If yes then your css file is set to work on.
2. You can create new regions in page.tpl.php
Hmm the Css file doesnt seem
Hmm the Css file doesnt seem to be working. I have added it to the .info file like so:
Is there anywhere else i need to add it to?.
Also shouldnt i be able to change regions with css? Since I'm trying to increase the size of an existing region (Navigation bar), isnt stuff like its size and position defined in the stylesheet?
What i just tried to do was
What i just tried to do was make the navigation region larger by going into the navigation.css and adding a height to the region. It does increase the height but its overlapped by the sidebar and the content area. So its not pushing the other stuff down.
http://i220.photobucket.com/albums/dd201/jonas612/Screenshot-2.png
As you can see i looked at the element with firebug and the majority of the region now lies under the content and the sidebar.
How do I make it that the sidebar and content is pushed down?
If everything is made up of floating Divs shouldn't that just happen?
1. In your page.tpl.php file
1. In your page.tpl.php file you need to move the navigation outside the main wrapper and and put it in between header and main wrapper so it will be like :
Here I have copy pasted the code from zen themes page.tpl.php and moved the navigation out of main wrapper.
2. Add css in your theme.css file:
#navigation {
height: 5em; /* increase the height of navigation */
}
#main-wrapper {
float:left;
}
#footer {
float:left;
}
3. Please clear the cache and check your page if it is picking up the css.
Thanks,
Prajakta
add to info file
add to info file :
stylesheets[all][] = theme.css
replace with
stylesheets[all][] = css/theme.css
and put your theme.css file in css folder.
How do I make it that the sidebar and content is pushed down? :
this also can be done from theme.css file just add
it will give some space between header and content.
1. Thanks for that the
1. Thanks for that the theme.css works now.
2. I figured out the problem: The height of the navigation region was already defined in the layout-fixed.css. Which was constantly over-riding my theme.css so I could never alter the height of the region to begin with. But when I changed height in the layout-fixed.css it also pushed the other content down. So no altering to the page.tpl.php file is needed.
This raises another question how does drupal do the css sheet over-riding how does drupal know which stylesheet has priority over the other? Since the height in my theme.css had a black line through it in firebug which i guess means that it was over-rided.
Can I make my theme.css have high priority? Do i even want that?
CSS file priority
Hi jp667,
css file priority is dictated by the order of css files in your subtheme's '[YOUR_THEME_NAME].info.txt' file. Place your custom 'theme.css' just above the 'css/print.css' file as shown below:
HTH,
Doug