R
R
RudFox2020-09-23 12:36:51
1C-Bitrix
RudFox, 2020-09-23 12:36:51

How to set styles for a specific directory?

Please tell me how to set your styles in the code for a specific section, for example: /catalog/aksessuary/, through style so that they are applied only to this page?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2020-09-23
@RudFox

Clumsily like this:

<?
if (CSite::InDir('/catalog/aksessuary/')){
        ?><style>.html{width:90%;}</style><?
}
?>

At the top of the index.php file in the catalog folder.

D
Daulet, 2020-09-23
@phpneguru

You can use this solution, write in the template code:

<?php 
if($_SERVER['REQUEST_URI'] == '/catalog/aksessuary/'){ 
$content = "<style>ТУТ ВСЕ ВАШИ СТИЛИ</style>";
  echo $content;
?>

J
Jupiter Max, 2020-09-23
@vardoLP

Or so

<?
if (CSite::InDir('/catalog/aksessuary/')){
        ?><link rel="stylesheet" type="text/css" href="<?=SITE_TEMPLATE_PATH?>/css/aksessuary.css" /><?
}
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question