html - CSS hover table cell -
i got table , have different text boxes when hovering on cells.
<div class="plan"> <h2 class="title">premium</h2> <div align="center"> <p class="plan-price">499<span>€</span></p> </div> <ul class="plan-features"> <li><strong>hello1</strong></li> <li><strong>hello2</strong></li> <li><strong>hello3</strong>></li> <li><strong>hello4</strong></li> <li><strong>hello5</strong></li> </ul> <a href="#" class="plan-button">start now</a> </div>
i show box text when example user move pointer on hello1.
this css code
.plan-features { margin-bottom: 20px; line-height: 2; font-size: 12px; color: #999; text-align: center; } .plan-features > li > strong { font-weight: bold; color: #888; } .box:hover{ text-align: center; color: white; width: 200px; margin: 10px -12px; height: 100px; background-color: rgba(0,0,0, 0.8); }
i tried add first <li>
tag
<ul class="plan-features"> <div class="box"><li><strong>hello1</strong></li></div>
but box shown text "hello1", how can hide "hello1" , add other text?
you can this! tried implement according requirements. explain trying achieve this. should there different text each li
element? there other ways too. simpler this
html
<div> <strong class="overlap hoveron">hello1</strong> <strong class="overlap hide">sometext</strong> </div>
css
div { position:relative; } .overlap { position:absolute; top:0; left:0; } .hide { display: none; background: red; } .hoveron:hover + .hide { display: block; }
cheers!
Comments
Post a Comment