Design comparison
SolutionDesign
Solution retrospective
What specific areas of your project would you like help with?
I need help with the forms section of the project. How to get the border color of the input element change in color and also display a p element below the input element when the form button is hovered on
Community feedback
- @MikDra1Posted 3 months ago
To change the border color of an input element and display a <p> element when the form button is hovered using only CSS, you can use sibling combinators and the :hover pseudo-class.
/* Initially hide the <p> element */ p { display: none; } /* Change the border color of the input when the button is hovered */ button:hover + input { border-color: red; } /* Display the <p> element when the button is hovered */ button:hover + input + p { display: block; }
Hope this comment will be helpful 💗
Good job and keep going 😁😊😉
0@Vyshin77Posted 2 months agoI did as you suggested but unfortunately it didn't work @MikDra1
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord