ben03 Posted November 23, 2018 Share Posted November 23, 2018 Hi, Can you use 'a' and 'a :focus' as conditional to hide/show another element? The following doesn't seem to work. Is it likely to with some re-working, or is this a no-no? a + span{display: none;} a:focus + span{display: block;} <a>Anchor</a><span><input /></span> Thanks Link to comment Share on other sites More sharing options...
dsonesuk Posted November 23, 2018 Share Posted November 23, 2018 It only becomes focusable if it has a href with a value, such as "#" Link to comment Share on other sites More sharing options...
ben03 Posted November 26, 2018 Author Share Posted November 26, 2018 I did not realise that. Sorted. Thank you dsonesuk! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now