Answer the question
In order to leave comments, you need to log in
How to include css file in bitrix?
There is a page that requires its own styles (body, container, etc.), the previous developer just wrote styles in style for index.php, attention to the question: how to connect styles to index.php ?
Or how to include styles in the template so that they do not conflict?
Or create a separate template? (there are not many styles, the page is simple, like 404)
Answer the question
In order to leave comments, you need to log in
https://dev.1c-bitrix.ru/api_d7/bitrix/main/page/a...
<?
use Bitrix\Main\Page\Asset;
Asset::getInstance()->addJs('/путь/скрипт.js');
Asset::getInstance()->addCss('/путь/стиль.css');
Asset::getInstance()->addString('<meta itemprop="name" content="Название сайта"/>');
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question