Bitrix Site Manager

CMain::GetCSS

string
CMain::GetCSS(
 bool external = true
)

The method GetCSS retrieves the CSS of the page. The CSS can be assigned by calling CMain::SetAdditionalCSS or CMain::SetTemplateCSS. In addition to the user-assigned CSS, the method always returns styles of the current site template defined in the file /bitrix/templates/template ID/styles.css.

Parameters

ParameterDescription
external If true, the method emits the HTML code of the link to an external CSS. For example:
<LINK 
 href="/bitrix/templates/demo/styles.css" 
 type="text/css" 
 rel="stylesheet">
If false, the inline CSS is generated. For example:
<style type="text/css">
body
{
    margin: 0px; 
    padding:0px; 
    background-color: #FFFFFF
}
...
</style>
The CSS stored in the folder /bitrix/modules/ are always included as the inline CSS (generally used in the standard components).

See Also