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 when 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.
Highlight selected Tab - Python webpage