Adjusting this HTML to trigger once group is hovered

Hi guys!

I found this cool HTML somewhere in the forum which creates a word (in this case “Cool Line”) that has an animated underline when hovered:


h1 { color: #666;display:inline-block; margin:0;text-transform:uppercase; }
h1:after {
	content: '';
	border-bottom: solid 3px #019fb6;  
	transform: scaleX(0);  
	transition: transform 250ms ease-in-out;
	padding-bottom: 3px;  

h1:hover:after { transform: scaleX(1); }

<h1 class="fromCenter">Cool Line</h1><br/>

Is it possible for that text to become underlined once something else is hovered instead, like a group that this HTML sits within?


This topic was automatically closed after 70 days. New replies are no longer allowed.