Highlight selected Tab - Python webpage
I am trying to develop my first python web project. It have multiple tabs (like apple.com have Store, iPhone, iPad etc tabs) and when user click on any tab, the page is served from server. I want to make sure that the selected tab will have different background color 开发者_如何学Pythonwhen page is loaded. Which is a best way to do it? JavaScript/CSS/Directly from server? and How? Thanks.
I think the best way would be through CSS. You can handle it by adding the pseudoclass :active
to the CSS.
Other way is serving the page with a new class added to the tab, which will change the background color, but I would not recommend that.
精彩评论