Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

hover effect on sibling element tailwind

/* Mark the sibling with the 'peer' class
Now you can use 'peer-focus', 'peer-hover',.. to style the target element

https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-sibling-state
*/
<div>
	<div class='peer'>Some Div</div>
	<div class='peer-hover:bg-rose-300 peer-focus:bg-white'>
		Another Div
	</div>
</div>
 
PREVIOUS NEXT
Tagged: #hover #effect #sibling #element #tailwind
ADD COMMENT
Topic
Name
8+5 =