This question already has an answer here:
- Get Current URL from a PHTML - Magento 2 3 answers
How can I get the current page URL from browser ?
Actually I wants to highlight the current category Name by giving some class or id to it.So for that based on browser URL I will put some condition for adding class to current category.
How can I achieve this in magento 2 ?