Documentation

GetCSS

string
 CMain::GetCSS(
 bool external = true,
 bool bXhtmlStyle = true
)

The method 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. Non-static method.

Parameters

8.5.3
ParameterDescription Available from version
externalIf 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).
bXhtmlStyleThis parameter defines the standard of HTML tags. If true, the tags are displayed according to the XHTML standard (<meta />), otherwise, the HTML 4 standard is used (<meta>). This parameter was introduced in the kernel version 8.5.3. Optional, by default the value is true.

See Also



© «Bitrix24», 2001-2022
Up