Note that there are some explanatory texts on larger screens.

plurals
  1. POtext and image sprites on UL horizontal menu
    text
    copied!<p>im trying to build a horizontal menu with images sprites and text</p> <p>Here is an image of what i want but failing to accomplish with css.</p> <p><img src="https://i.stack.imgur.com/CH5uv.jpg" alt="Fig1"></p> <p>my css looks like this.</p> <pre> #top_menu { color: #FFFFFF; height: 40px; background-color:#222; float: right; } #top_menu ul { font-size: 13px; margin-top: 13px; } #top_menu li { display: inline; list-style-type: none; padding-right: 10px; } .sprite {background:url(images/sprite.png);} .transparent {background:url(/images/transparent.png);} .contact {height:18px;} /*Top menu icons*/ .sales{width:13px;background-position:-1px -72px;} .login{width:13px;background-position:-15px -72px;} .forum{width:13px;background-position:-29px -72px;} .livechat{width:13px;background-position:-44px -72px;} </pre> <p>The html part</p> <pre><code> &lt;div id="top_menu" class="grid_6"&gt; &lt;ul id="top_nav"&gt; &lt;li class="sprite contact sales"&gt;&lt;span&gt;Sales:1-800-555-7777&lt;/span&gt;&lt;/li&gt; &lt;li class="sprite contact login"&gt;&lt;span&gt;Administrator&lt;/span&gt;&lt;/li&gt; &lt;li class="sprite contact forum"&gt;&lt;span&gt;Forum&lt;/span&gt;&lt;/li&gt; &lt;li class="sprite contact livechat"&gt;&lt;span&gt;Live Chat&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>As you can see, the images are on top of the text and also showing more than one icon. :( <img src="https://i.stack.imgur.com/Fmanq.png" alt="Fig2"></p> <p>Can anyone please help me out with this? I don't want to call each icon by separate. Thanks a lot!</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