Documentation

ShowCSS

CMain::ShowCSS(
 cMaxStylesCnt = true,
 bXhtmlStyle = true
)

The method displays the CSS of the page.

This method utilizes the delay function technology allowing to specify CSS of a page (for example, inside a component) after the site prologue was displayed. Non-static method.

Parameters

ParameterDescription Available from version
cMaxStylesCntIf "true", the HTML code for the link to an external CSS is displayed. For example:
<LINK href="/bitrix/templates/demo/styles.css" type="text/css" rel="stylesheet">
If "false", the HTML code for an internal CSS is displayed, for example:
<style type="text/css">
body { margin: 0px; padding:0px; background-color: #FFFFFF}
...
</style>
Exception is the CSS styles located in the /bitrix/modules/ folder; they are always included as internal CSS (usually it is used in standard components).
Prior to version 8.5.3 is was called bExternal.
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

Examples of use

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= LANG_CHARSET;?>">
<META NAME="ROBOTS" content="ALL">
<?$APPLICATION->ShowMeta("keywords")?>
<?$APPLICATION->ShowMeta("description")?>
<title><?$APPLICATION->ShowTitle()?></title>
<?$APPLICATION->ShowCSS();?>
</head>
<body link="#525252" alink="#F1555A" vlink="#939393" text="#000000">
...


© «Bitrix24», 2001-2024
Up