Note that there are some explanatory texts on larger screens.

plurals
  1. POHaving issue with CSS hover with different hover size
    primarykey
    data
    text
    <p>Now what I am doing is having a text nav but then on hover still keeping the text but using an image as the background.</p> <p>Because the text is varying sizes &amp; the background image is one size it's becoming a problem because I only have 597px to work within for the nav area &amp; I also want the same amount of spacing between each nav selection.</p> <p>I want this for example..</p> <p><img src="https://i.stack.imgur.com/QmxYS.png" alt="enter image description here"></p> <p>But currently I am getting this:</p> <p><img src="https://i.stack.imgur.com/TLpD8.png" alt="enter image description here"></p> <p>The nav background image is 87px in width, so obviously it's wrapping because we don't have enough space. But we also end up with varying amounts of space between each nav item because each is set to 87px.</p> <p>So I was wondering if there was any clean way to do what I want without using javascript &amp; without the nav items jumping around when hovering over others?</p> <p>I've tried putting differing widths on the different states but the nav just jumped around &amp; looked terrible.</p> <p>Any idea to do what I'm wanting?</p> <p>If you would like to see my current HTML &amp; CSS it's below:</p> <p>HTML:</p> <pre><code>&lt;div class="nav_wrapper"&gt; &lt;ul class="nav"&gt; &lt;li&gt;&lt;a href="index.php"&gt;HOME&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="about.php"&gt;ABOUT US&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="services.php"&gt;SERVICES&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="our_process.php"&gt;OUR PROCESS&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="portfolio.php"&gt;OUR WORK&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;BLOG&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="free_quote.php"&gt;FREE QUOTE&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="contact_us.php"&gt;CONTACT US&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!-- Nav Ends --&gt; &lt;div class="contentClear"&gt;&lt;/div&gt; &lt;/div&gt; &lt;!-- Nav Wrapper Ends --&gt; </code></pre> <p>CSS:</p> <pre><code>#header .nav_wrapper { float: left; width: 597px; margin: 30px 0 0 50px; } #header .nav_wrapper .nav { list-style-type: none; list-style-image: none; } #header .nav_wrapper li { float: left; height: 23px; min-width: 87px; font-family: "Zurich Cn BT", Tahoma; font-size: 12px; text-align: center; } ul.nav li a, ul.nav li a:visited, ul.nav li a:focus { display: block; line-height: 23px; color: #764422; text-decoration: none; } ul.nav li a:hover, ul.nav li a:active { color: #fff; text-decoration: none; background-image: url(../images/nav-bg.png); } </code></pre>
    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.
 

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