Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>1: Format your css please.<br> 2: That code seems to be missing the bits that actually make it work?</p> <p>Now as for the answer:<br> General concept: you should set the child elements (.dropdown) to <code>width:100%</code>, and your parent elements (.top_level) should have <code>position:relative;</code> set. <br> This means that the absoute positioning of the children will be done relative to the parents (This is to do with the weirdness about how positioning <a href="http://www.w3.org/wiki/CSS_absolute_and_fixed_positioning#Containing_blocks">interprets your wishes.</a>), and then their width will be set to be the same as the parents' width. Yay! </p> <p>Then of course, that doesn't actually work - I believe because of your <code>display:inline</code> on your top levels there. I've changed your parent elements to display:block;, then made them float to bring them back up next to each other again.</p> <p>[You could also do this with <code>display:inline-block;</code> instead of the float, depending on what kind of behaviour you actually want]</p> <p><b>See revised (indented) css:</b></p> <pre><code>#menu li.top_level{ vertical-align:top; zoom:1; display:block; float:left; width:auto; position:relative; margin:2px;padding:0 1px 0; } #menu .dropdown{ float:none; z-index:100; position:absolute; width:100%; height:0; overflow:hidden; -webkit-transition:height 700ms;-moz-transition:height 700ms; } #menu .category:hover .dropdown,#menu .category:focus .dropdown{ -webkit-transition:height 940ms; -moz-transition:height 940ms; height:auto; } </code></pre> <p>I've also thrown up a demo on jsfiddle to work on this, if you want to take a look: <a href="http://jsfiddle.net/UPRAc/1/">http://jsfiddle.net/UPRAc/1/</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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