Note that there are some explanatory texts on larger screens.

plurals
  1. POBackground image position on navigation item
    primarykey
    data
    text
    <p>Not too sure what I'm doing wrong here. I swear I've had this working in the past, but for some reason I cannot get the background image to show when you hover over the navigation item.</p> <p>I've tried to add a width, but that doesn't seem to work. That only makes the hover all sorts of crazy.</p> <p>Here's the current CSS:</p> <pre><code>.nav ul li { display: inline-block; margin-left: 15px; } .nav ul li a { text-decoration: none; color: #760706; display: block; position: relative; } .nav ul li a:hover { background: url(imgs/ornament.png) -10px 2px no-repeat; } </code></pre> <p>But this is the current result when you hover:</p> <p><img src="https://i.stack.imgur.com/e8SUF.png" alt="enter image description here"></p> <p>If I increase the width of the anchor element and change it to <code>inline-block</code> it only increases the width of the navigation:</p> <p>CSS:</p> <pre><code>.nav { float: right; font: 1.2rem "rosewoodfill", Georgia, "Times New Roman", Times, serif; margin-top: 35px; } .nav ul li { display: inline-block; margin-left: 15px; } .nav ul li a { text-decoration: none; color: #760706; display: inline-block; position: relative; width: 150px; } .nav ul li a:hover { background: url(imgs/ornament.png) -10px 2px no-repeat; } </code></pre> <p>Result:</p> <p><img src="https://i.stack.imgur.com/oRiDp.png" alt="enter image description here"></p> <p>Not too sure if I am missing something or what.</p> <p>I created a pen to help illustrate what I'm trying to do:</p> <p><a href="http://codepen.io/ultraloveninja/pen/GfAuI" rel="nofollow noreferrer">http://codepen.io/ultraloveninja/pen/GfAuI</a></p>
    singulars
    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.
    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