现在有个需求,就是在导航栏上有若干个按钮,我想实现的功能是当点击某个按钮后修改文字颜色,这样网站会更人性化。现总结方法如下:
index.html
:
HomeAbout
app.views.py
def home(reqeust):isactive = "home"return render(request, "home.html", {"isactive":isactive})def about(reqeust):isactive = "about"return render�ȼ�,�ü�(request, "about.html", {"isactive":isactive})