I am trying to get rid of the left and right spacing seen here between the colors:


I am trying to create a custom theme on WordPress with Bootstrap.

I have tried to remove padding, which just makes the colored li smaller and the a pushed to the edges.

I also tried removing margin, but that didn’t get me anywhere.

Here is the relevant Header.php content:

<div class="blog-masthead">
  <div class="container">
    <nav class="blog-nav">
      <?php $directoryURI = $_SERVER['REQUEST_URI']; $path = parse_url($directoryURI, PHP_URL_PATH); $components = explode('/', $path); $part = $components[2]; ?>
      <a class="blog-nav-item <?php if ($part=="") {echo 'current_page_item'; } else  {echo '';}?>" href="<?php echo get_bloginfo( 'wpurl' );?>">HOME</a>
      <?php wp_list_pages( '&title_li=' ); echo $_GET['pg']; ?>

Best regards,

Read more here: How do I get rid of the nav menu margin in Bootstrap/Wordpress?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: