html - Image-menu with hover-effect with one image only? -


i've built site typo3 (4.7.2) has nice graphical menu on right hand side (see here). not user-friendly nor easy maintain, bit of hack , doesn't use "typo3-standards", general html/css-hacking:

the menu's html is:

<p id="kat">  <a target="_blank" href="http://www.fusspflege.com/elkat/op/">   <img src="/fileadmin/images/baehr_katalog2.png" />  </a> </p> 

and corresponding css:

  #kat {     background: url("/fileadmin/images/baehr_katalog2_hover.png") no-repeat;     display:block; height:120px; width:220px; /* linkbereich begrenzen */   }    #kat img {     display:block; width:220px; height:120px; border:0;   }    #kat a:hover img {     visibility: hidden;   } 

so show image white font in "standard mode" , when mouse hovers, image hidden , same image (with black font) in background becomes visible. thought quite nice, , did not need js :-)

but i'm wondering if there way more elegant, robust , user-friendly (perhaps typo's tools?), user change images if needed without having worry css...

edit: found solution requiring 1 image! (text in transparent colour , css has this:

  #kat a:hover img {     background-color: black;   } 

but still wonder if there's not more typo-esque solution around? ;-)

if don't use text links (only image) able switch properties this:

#kat {      text-decoration: none;      display: block;      width: 220px;  }  #kat img {      border: 0;      max-width: 100%;      height: auto;      display: block;      opacity: .5;  }    #kat a:hover img {      opacity: 1;      transition: opacity 1s ease 0s;  }
<p id="kat">      <a target="_blank" href="http://www.fusspflege.com/elkat/op/">          <img src="http://lorempixel.com/440/220"/>      </a>  </p>


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -