0

Is there a way to have URL-related CSS-Styles?

For example. I have a link on my webpage

<a href="#blue">Blue</a>

after clicking the URL changes to test.com#blue

Is it possible to apply style depending on this URL?

background-color: blue;

1 Answer 1

2

Only the :target pseudo-class which will match elements with an id that matches the fragment identifier in the URL.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.