Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS3 Dropdown Menu hover different size
    primarykey
    data
    text
    <p>The hover state for the sub menu is 30px wider to the right side than intended. If I change the padding it affects everything and not just the hover state. I've been wracking my brains at this for hours so I am hoping for a few set of eyes to hopefully figure out what I am missing. </p> <p>Here is the HTML:</p> <pre><code>&lt;DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta harset="utf-8"&gt; &lt;link rel="stylesheet" type="text/css" href="css/drop.css"&gt; &lt;title&gt;CSS3 Pricing Tables&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;nav id="nav" role="navigation"&gt; &lt;a href="#nav" title="Show navigation"&gt;Show navigation&lt;/a&gt; &lt;a href="#" title="Hide navigation"&gt;Hide navigation&lt;/a&gt; &lt;ul class="menu" id="clearfix"&gt; &lt;li id="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Products&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#" class="infinity"&gt;NeuroSolutions Infinity&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="ns"&gt;NeuroSolutions&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="ns4ml"&gt;NeuroSolutions for MATLAB&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="csw"&gt;Custom Solution Wizard&lt;/a&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Custom Services&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Customers&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#" class="case-studies"&gt;Case Studies&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="testimonials"&gt;Testimonials&lt;/a&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Support&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#" class="app"&gt;Documentation&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="website"&gt;Intro to Neural Networks&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="website"&gt;Maintenance&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="website"&gt;Newsletter Archive&lt;/a&gt; &lt;li&gt;&lt;a href="#" class="website"&gt;Video Library&lt;/a&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Order&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here is the CSS:</p> <pre><code>#clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; eight: 0; } * html #clearfix { zoom: 1; } *:first-child+html .clearfix { zoom: 1; } /* Reset */ .menu, .menu ul, .menu li, .menu a { margin: 0; padding: 0; border: none; outline: none; } #nav { width: 100%; height: 40px; margin: 0; padding: 0; background-color: #4f4f4f; background: linear-gradient(top, #4f4f4f 0%, #343434 100%); background: -moz-linear-gradient(top, #4f4f4f 0%, #343434 100%); background: -webkit-linear-gradient(top, #4f4f4f 0%, #343434 100%); background: -ms-linear-gradient(top, #4f4f4f 0%, #343434 100%); } .menu { height: 40px; padding-left: 3%; width: auto; background-color: #4C4E5A; margin: 0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; background: linear-gradient(top, #4f4f4f 0%, #343434 100%); background: -moz-linear-gradient(top, #4f4f4f 0%, #343434 100%); background: -webkit-linear-gradient(top, #4f4f4f 0%, #343434 100%); background: -ms-linear-gradient(top, #4f4f4f 0%, #343434 100%); } #nav &gt; a { display: none; } #nav li { list-style: none; float: left; display: block; height: 40px; margin: 0; position: relative; z-index: 1; } #nav li a { display: block; text-decoration: none; font-weight: bold; color: #FFF; font-size: 85%; padding: 0 15px; margin: 0; line-height: 40px; } #nav li:first-child a { border-left: none; } #nav li:last-child a { border-left: none; } #nav li:hover &gt; a { background-color: #4685d2; color: #FFF; } #nav li a:active { background-color: #4685d2 !important; } /* first level */ #nav &gt; ul { height: 100%; } #nav &gt; ul &gt; li { height:100%; float: left; } #nav &gt; ul &gt; li &gt; a { height:100%; text-align: center; } /* second level */ .menu ul { position: absolute; width: 250px; padding: 0; margin: 0; opacity: 0; background: #343434; transition: opacity .25s ease .1s; -moz-transition: opacity .25s ease .1s; -webkit-transition: opacity .25s ease .1s; -ms-transition: opacity .25s ease .1s; } .menu li:hover &gt; ul { opacity: 1; } .menu ul li { height: 0; overflow: hidden; padding: 0; } .menu li:hover &gt; ul li { height: auto; overflow: visible; } .menu ul li a { width: 250px; margin: 0; padding: 5px 15px; border: none; } .menu ul li:first-child a { border: none; } #nav li:hover ul { display:block; width: 250px; padding: 0; margin: 0; } @media only screen and ( max-width:62.5em ) /* 1000 */ { #nav { width:100%; position:static; margin:0; } } @media only screen and ( max-width:40em ) /* 640 */ { html { font-size:75%; /* 12 */ } #nav { position:relative; top:auto; left: auto; } #nav&gt;a { width:3.125em;/* 50 */ height:3.125em;/* 50 */ text-align:left; text-indent:-9999px; background-color:#e15a1f; position:relative; } #nav&gt;a:before, #nav&gt;a:after { position:absolute; border:2px solid #fff; top:35%; left:25%; right:25%; content:''; } #nav&gt;a:after { top:60%; } #nav:not(:target )&gt;a:first-of-type, #nav:target&gt;a:last-of-type { display: block; } /* first level */ #nav&gt;ul { height:auto; display:none; position:absolute; left:0; right:0; } #nav:target&gt;ul { display:block; } #nav&gt;ul&gt;li { width:100%; float:none; } #nav&gt;ul&gt;li&gt;a { height:auto; text-align:left; padding:0 0.833em; /* 20 (24) */ } #nav&gt;ul&gt;li:not(:last-child )&gt;a { border-right:none; border-bottom: 1px solid #cc470d; } /* second level */ #nav li ul { position:static; padding:1.25em;/* 20 */ padding-top:0; } } </code></pre>
    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.
    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