CodeExample:JHtml::stylesheet
From Joomla! Documentation
Including stylesheet with Joomla lookup (and other) guessing
From Joomla! onwards, if you include stylesheets in extensions as thus:
JHtml::stylesheet('com_mycomponent/default.css', array(), true);
..you wil get one of the following results if the file exists in the corresponding path:
- /templates/[template]/css/com_mycomponent/default.css - /media/com_mycomponent/css/default.css - /media/system/css/com_mycomponent/default.css - /templates/[template]/css/system/default.css - /media/system/css/default.css
Some other possibilities were left out, such as when an extra folder is given (which gives some swapping with folders, file and extension) or such as browser detection (e.g. default_mozilla.css or default_mozilla_5_0.css)
E-motiv (former E-builds) (talk) 12:13, 4 October 2012 (CDT)