Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make submenus have the same width as the menu CSS/HTML5
    primarykey
    data
    text
    <p>I am trying to make a vertical navigation menu, i am very new to coding and am getting a little lost. The Menu works how i want to and looks fine other than I wanted the submenu to have the same width as the actual menu please help! I also could do with some assistance with centering the menu, i tried text-align, to no avail </p> <p>Here is my HTML </p> <pre><code>&lt;div id='cssmenu'&gt; &lt;ul&gt; &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;About Us&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Vehicles&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Prices&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class='has-sub last'&gt;&lt;a href='#'&gt;&lt;span&gt;Contact Us&lt;/span&gt;&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href='#'&gt;&lt;span&gt;Book A Lesson&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class='last'&gt;&lt;a href='#'&gt;&lt;span&gt;Send Us A Message&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>and CSS</p> <pre><code> #cssmenu { border: none; border: 0px; margin: 0px; padding: 0px; font: 80% 'Lucida Sans Unicode', 'Bitstream Vera Sans', 'Trebuchet Unicode MS', 'Lucida Grande', Verdana, Helvetica, sans-serif; font-size: 16px; font-weight: bold; width: 100%; text-align: center; } #cssmenu ul { text-align: center; background: #000000; height: 40px; list-style: none; margin: 0; padding: 0; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; -webkit-box-shadow: inset 0px 16px 0px 0px rgba(255, 255, 255, 0.1); -moz-box-shadow: inset 0px 16px 0px 0px rgba(255, 255, 255, 0.1); box-shadow: inset 0px 16px 0px 0px rgba(255, 255, 255, 0.1); } #cssmenu li { text-align: center; float: left; padding: 0px 0px 0px 15px; width: 18%; } #cssmenu li a { color: #ffffff; display: block; font-weight: normal; line-height: 50px; margin: 0px; padding: 0px 25px; text-align: center; text-decoration: none; } #cssmenu li a:hover { background: #f6dc30; color: #000000; text-decoration: none; -webkit-box-shadow: inset 0px 0px 7px 2px rgba(0, 0, 0, 0.3); -moz-box-shadow: inset 0px 0px 7px 2px rgba(0, 0, 0, 0.3); box-shadow: inset 0px 0px 7px 2px rgba(0, 0, 0, 0.3); } #cssmenu ul li:hover a { background: #f6dc30; color: #000000; text-decoration: none; } #cssmenu li ul { display: none; height: auto; padding: 0px; margin: 0px; border: 0px; position: absolute; z-index: 200; } #cssmenu li:hover ul { display: block; } #cssmenu li li { display: block; float: none; margin: 0px; padding: 0px; width: 170px; background: #000000; } #cssmenu li:hover li a { background: none; background: #f6dc30; } #cssmenu li ul a { display: block; height: 50px; font-size: 12px; font-style: normal; margin: 0px; padding: 0px 10px 0px 15px; text-align: left; } #cssmenu li ul a:hover, #cssmenu li ul li:hover a { background: #f6dc30; border: 0px; color: #000000; text-decoration: none; } </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.
 

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