开发者

Highlight selected Tab - Python webpage

开发者 https://www.devze.com 2023-01-05 12:56 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消