With the inheritance of the template engine, how can we change the background color of the current page connection;

Source: Internet
Author: User
Using the inheritance of the template engine, how to change the background color of the current page connection; base.htm of the base template, including the navigation bar;



1. htm 2.htm 3.htm is a column that inherits base.htm;

For example, when you click the link of navigation 3.htm, the page 3.htmis displayed. in 3.htm, the background color of the three topics in the navigation changes;


1. method: JavaScript can be used to obtain the current URL and then compare the link in the navigation bar. if the same, the background color is changed;
2. method: it is very troublesome to change each topic into a module and overwrite the corresponding module each time it is loaded;
3. for a normal method, I think other people's programs do not use the above method or AJAX. how can I do this? thank you.




Reply to discussion (solution)

If you do this, you just need to activate the 3.html navigation directly?

Change the css file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.