[themes] CSS questions I don't seem to be able to find on Drupal.org...

Andrew Hankinson andrew.hankinson at gmail.com
Fri Feb 18 12:51:37 UTC 2011


An HTML element can have a class attached to it without necessarily having a corresponding entry in a CSS file. Many of the elements in Drupal have (multiple) dynamically generated class names that are attached when the element is created in PHP, often times with sequential numbering (the 114th menu item, for example, may get <li id="menu-114">).

The query parameter at the end of the CSS call is often used to prevent browsers from caching the CSS files. Since this changes at every request, the browser will not be able to tell the difference between ?lgkgm7 and ?asf7xx, and will thus fetch the CSS file again. Often this means that you have your "Optimize CSS" turned on in your site performance options - you should turn it off while you are developing.


On 2011-02-18, at 1:54 AM, Michael Donahue wrote:

> Hello and greetings,
> 
> I am trying to understand the internals of themes and have run into a few questions that seem to be related. I was hoping to find some enlightenment from the list. TIA for any replies.
> 
> I found references to several classes that I can not find in any .css files on the order of:  <li class="menu-114">. While I was trying to find the .css file that contained these class definitions, I notice that in the page source, in the marinelli theme for example, many calls to css file that have references attached to them, i.e. links.css?lgkgm7. Can someone explain what this means? I think the menu-xxx classes are being generated dynamically but I do not understand where that is happening and it appears to be inconsistent whether it is defined as a class or as an id in the page code dumps that I have examined. 
> 
> Appreciate your attention, 
> 
> Kindest regards, Michael
> _______________________________________________
> themes mailing list
> themes at drupal.org
> http://lists.drupal.org/mailman/listinfo/themes



More information about the themes mailing list