title: Anchor does not stretch across full width of the sidebar
body: <p>I'm having an issue with my anchors not covering full width of the sidebar (for instance, 'Search'). I realise that this is because of padding, but I'm not sure how to overcome the issue whilst keeping the padded effect. I have tried to add a class (like, '<code>.no-submenu</code>) on the <code>&lt;li&gt;</code> and did <code>.no-submenu a { margin: 0 -1.5rem; padding: 0 3rem; }</code>, but it only partially solved the problem - my icons were off, they go all the way to the left:</p>
  
  <p><a href="https://i.stack.imgur.com/ve1S3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ve1S3.png" alt="screenshot"></a></p>
  
  <p>I couldn't find the place online to upload SVG files (my icons are SVG), so I created a minimal example without icons. Icons are handled as background-image on the anchors.</p>
  
  <pre><code>&lt;div class="sidebar"&gt;
    &lt;nav&gt;
      &lt;ul class="menu"&gt;
        &lt;li id="search"&gt;
          &lt;a class="sidebar-icon" href="/search/notes/"&gt;Search&lt;/a&gt;
        &lt;/li&gt;       
        &lt;li id="dashboard"&gt;
          &lt;a class="sidebar-icon"&gt;Dashboard&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id="notebooks" class="has-submenu"&gt;
          &lt;div class="menu-item"&gt;
            &lt;span class="sidebar-icon"&gt;Notebooks&lt;/span&gt;
            &lt;span class="arrow"&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;ul class="submenu"&gt;
            &lt;li id="new-notebook"&gt;&lt;a class="sidebar-icon" href="/notebooks/create/"&gt;New Notebook&lt;/a&gt;&lt;/li&gt;
            &lt;li id="view-notebooks"&gt;&lt;a class="sidebar-icon" href="/notebooks/"&gt;View Notebooks&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li id="tags" class="has-submenu"&gt;
          &lt;div class="menu-item"&gt;
            &lt;span class="sidebar-icon"&gt;Tags&lt;/span&gt;
            &lt;span class="arrow"&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;ul class="submenu"&gt;
            &lt;li id="view-tags"&gt;&lt;a class="sidebar-icon" href="/tags/"&gt;View Tags&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li id="account" class="has-submenu"&gt;
          &lt;div class="menu-item"&gt;
            &lt;span class="sidebar-icon"&gt;Account&lt;/span&gt;
            &lt;span class="arrow"&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;ul class="submenu"&gt;
            &lt;li id="settings"&gt;&lt;a class="sidebar-icon" href="/accounts/settings/"&gt;Settings&lt;/a&gt;&lt;/li&gt;
            &lt;li id="logout"&gt;&lt;a class="sidebar-icon" href="/accounts/logout/"&gt;Logout&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,600);
  @font-face { font-family: "ionicons"; src: url("https://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.eot?v=2.0.1"); src: url("https://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.eot?v=2.0.1#iefix") format("embedded-opentype"), url("https://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.ttf?v=2.0.1") format("truetype"), url("https://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.woff?v=2.0.1") format("woff"), url("https://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.svg?v=2.0.1#Ionicons") format("svg"); font-weight: normal; font-style: normal; }
  
  .sidebar {
    width: 200px;
    height: 100vh;
    padding: 1rem 1.5rem;
    background-color: #348ceb;
    font-family: 'Source Sans Pro';
    font-size: 14px;
    position: fixed;
    box-sizing: border-box;
  }
  
  ul {
    list-style: none;
  }
  
  ul, li {
    padding: 0;
    margin: 0;
  }
  
  li {
    padding: 0.5rem 0;
  }
  
  .submenu {
    display: none;
    overflow-y: hidden;
    margin: 0 -1.5rem;
    background-color: #3287e3;
  }
  
  .submenu li:first-child {
    padding: 0.1rem 0 0 1.5rem;
  }
  
  .submenu li:last-child {
    padding: 0 0 0.1rem 1.5rem;
  }
  
  .submenu li {
    padding: 0.5rem 1.5rem;
  }
  
  .menu &gt; li:hover {
    background-color: #3287e3;
  }
  
  .menu &gt; li {
    position: relative;
    color: #F9FAFC;
    font-weight: bold;
    margin: 0 -1.5rem;
    padding: 0.5rem 1.5rem;
  }
  
  .menu &gt; li &gt; a {
    display: block;
    color: #F9FAFC;
    text-decoration: none;
    font-weight: bold;
  }
  
  .menu &gt; li &gt; a:hover {
    color: white;
  }
  
  .submenu &gt; li &gt; a {
    display: block;
    color: #F9FAFC;
    text-decoration: none;
  }
  
  .submenu &gt; li &gt; a:hover {
    color: white;
  }
  
  .submenu &gt; li {
    font-weight: normal !important;
  }
  
  .arrow {
    display: inline-block;
    width: 10px;
    transition: all 0.5s ease-in-out;
    transform-origin: left center;
    font-size: 0.5em;
    position: absolute;
    right: 0.75em;
  }
  
  .arrow:after {
    content: '\f125';
    font-family: 'ionicons';
    color: white;
  }
  
  .rotated {
    transform: rotate(90deg);
    transition: transform 0.5s ease;
  }
  
  .menu-item {
    display: flex;
    align-items: center;
  }
  
  .menu-item &gt; span:first-child {
    flex: 1;
  }
  
  .sidebar-icon {
    background-repeat: no-repeat;
    padding-left: 25px;    
  }
  </code></pre>
  
  <p>JS (jQuery):</p>
  
  <pre><code>$(document).ready(function() {
    $('.has-submenu').click(function() {
      $(this).toggleClass('active');
      $(this).children('.menu-item').children('.arrow').toggleClass('rotated');
      if ($(this).hasClass('active')) {
          $(this).children('.submenu').slideDown("slow");
      }
      else {
          $(this).children('.submenu').slideUp("slow");
      }
    });  
  });
  </code></pre>
  
  <p>How can I overcome the issue?</p>
  
  <p>Here is the <a href="https://codepen.io/lbastos/pen/MWWdEop" rel="nofollow noreferrer">demo</a>.</p>
  
  <p>@EDIT:</p>
  
  <p>so, I want this: </p>
  
  <p><a href="https://i.stack.imgur.com/cfr6b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cfr6b.png" alt="screenshot2"></a></p>
  
  <p>but the menu item has to be fully clickable, i.e. you can click on any part of it and it brings you to, say, Search. To see the area it currently covers, right-click on the anchor or inspect the element.</p>