Note that there are some explanatory texts on larger screens.

plurals
  1. POChange image and accompanying text on hover
    primarykey
    data
    text
    <p>I've got to design a menu bar which has two actions for it's links</p> <p>1) Before action where the icon is green</p> <p><img src="https://i.imgur.com/tNSZaYH.png" alt="before"></p> <p>2) On hover the icon should change to it's active version</p> <p><img src="https://i.imgur.com/l0fqjGf.png" alt="active"></p> <p>On changing to active version, I need the text to display too. Like this:</p> <p><img src="https://i.imgur.com/IgTCTcK.png" alt="with text"></p> <p>My current HTML for this is:</p> <pre><code>&lt;div class="span1 but"&gt; &lt;a href="#"&gt; &lt;div class="image-holder" id="about"&gt; &lt;/div&gt; &lt;div class="text-menu" id="about-text"&gt; About &lt;/div&gt; &lt;/a&gt; &lt;/div&gt; </code></pre> <p>Where <code>span1</code> is from Bootstrap while <code>but</code> is the css class as follows:</p> <pre><code>.but{ height:70px; } </code></pre> <p>the ID <code>#about</code> is defined as:</p> <pre><code>#about{ background:url('../img/about-green.png') no-repeat; background-size: 60px 60px; } #about:hover{ background:url('../img/about-active.png') no-repeat; background-size: 60px 60px; } </code></pre> <p>My current problem is such that on hover, I want the text to appear too. The text-box for this is defined as:</p> <pre><code>.text-menu{ text-align: center; margin-top: -10px; text-decoration: none; color: rgba(255,255,255,0); } </code></pre> <p>And the ID #about-text is:</p> <pre><code>#about-text:hover{ color: rgba(0,0,0,1); } </code></pre> <p>What should I do to make the text appear along with the image on hover?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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