R
R
Roman Grinberg2018-04-07 13:18:52
PHP
Roman Grinberg, 2018-04-07 13:18:52

How to change the background of a block on different pages?

There is a navigation menu, where there are several "tabs" so to speak. Each tab has the same standard background as the menu itself, and depending on which directory the person is in, the background color of the tab with the same name as the directory changes. How to do something like this? On each page, setting a background for each button is not an option, because an include is used.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yan-s, 2018-04-07
@GarfieldOfficial

Check which page we are on and set the css class to the corresponding menu item. This can be done both on the server side and on the client side, depending on how the application is organized as a whole.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question