Views: 10104
Last Modified: 24.10.2018
Stylesheets are connected to the site template in the prolog area via the ShowCSS()
function.
<?
$APPLICATION->ShowCSS();
?>
The ShowCSS()
function connects CSS file from the current site template, as well as all additional styles, defined for the this page by the function SetAdditionalCSS()
.
<?
$APPLICATION->SetAdditionalCSS("/bitrix/templates/demo/additional.css");
?>
Additional styles can be used, for example, to customize design elements of forum, web forms, tables, certain menu types, etc.
When using the ShowCSS()
function without parameters, styles will be connected as the link to the CSS file:
<LINK href="/bitrix/templates/demo/styles.css" type="text/css" rel="STYLESHEET">
The styles connected via the SetAdditionalCSS()
, will be included into the page code using the PHP function require()
(i. e. such styles will be fully included into the final page code).
When using the ShowCSS()
function with the parameter false
, the CCS file for the current design will be included into the page code via the require()
:
<?
$APPLICATION->ShowCSS(false);
?>