Answer the question
In order to leave comments, you need to log in
How to add styles to Bitrix header?
Added this code to header.php.
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
IncludeTemplateLangFile(__FILE__);
?>
<?php use Bitrix\Main\Page\Asset; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
Asset::getInstance()->addString('<meta http-equiv="X-UA-Compatible" content="IE=edge">');
Asset::getInstance()->addString('<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1">');
?>
<title><?$APPLICATION->ShowTitle();?></title>
<!-- Include CSS File -->
<?php
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . "/fonts/fonts.css");
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . "/css/style.css");
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . "/libs/owl.carousel.min.css");
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . "/libs/owl.theme.default.min.css");
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . "/libs/modal/style.css");
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question