Saturday, September 27, 2014

CSS Hover attribute reveal non-div element.

<style type="text/css">

span {
   display: none;
   font-size: 25px;
   color: #321321;
}
.something1:hover ~ [class*="text"] {
   display: block;
}

</style>

<div class="container">

<h2 class="something1">Hover on Me</h4>

<span class="text1">MaHi</span>
<span class="text2">MaHii</span>
<span class="text3">MaHiii</span>
<span class="text4">MaHiiii</span>

</div>

Output :)

1)

2)

No comments:

Post a Comment