Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show text on image when hovering?
    text
    copied!<p>I'm trying to show a description when hovering over an image. I've already done it in a less than desirable way, using image sprites and hovers here: <a href="http://willryan.us/design.html" rel="noreferrer">http://willryan.us/design.html</a> I want it to look exactly like how I have it, but using real text instead of an image.</p> <p>I've tried a few different things but I can't seem to figure out how to do it. I'm trying to do it using HTML and CSS only, but I'm not sure if that's possible.</p> <p>Feel free to poke around in my code, I'll paste what I think is relavent here.</p> <p><strong>HTML</strong></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>div#projectlist { width: 770px; margin: 0 auto; margin-top: 20px; margin-bottom: 40px; } div#buzzbutton { display: block; float: left; margin: 2px; background: url(content/assets/thumbnails/design/buzz_sprite.jpg) 0 0px no-repeat; width: 150px; height: 150px; } div#buzzbutton:hover { background: url(content/assets/thumbnails/design/buzz_sprite.jpg); width: 150px; height: 150px; background-position: 0 -150px; } div#slinksterbutton { display: block; float: left; background: url(content/assets/thumbnails/design/slinkster_sprite.jpg) 0 0px no-repeat; width: 150px; height: 150px; margin: 2px; } div#slinksterbutton:hover { background: url(content/assets/thumbnails/design/slinkster_sprite.jpg); width: 150px; height: 150px; background-position: 0 -150px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="projectlist"&gt; &lt;div id="buzzbutton"&gt; &lt;a href="buzz.html" title=""&gt;&lt;img src="content/assets/thumbnails/transparent_150x150.png" alt="" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;div id="slinksterbutton"&gt; &lt;a href="slinkster.html" title=""&gt;&lt;img src="content/assets/thumbnails/transparent_150x150.png" alt="" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload