"Elevate your design with a flexible, column-based Angular navbar using

I'm facing an issue in my angular project where I am trying to add a bootstrap navigation bar to the left of my screen. However, there is a small blank space that persists even after using a container-fluid.

Here is the code for my navigation bar:

<!-- admin.component.html -->
<div class="container-fluid">
  <div class="row">
    <div class="col-sm-2">
      <nav class="navbar navbar-light bg-dark">
        <ul class="nav flex-column">
          <li class="nav-item">
            <a class="nav-link" routerLink="/admin/themes">Themes and categories creation</a>
          </li>
        </ul>
      </nav>
    </div>
    <div class="col">

      <router-outlet></router-outlet>

    </div>
  </div>
</div>

This component is called in my app component like this:

<!-- app.component.html -->
<app-topbar></app-topbar>
<router-outlet></router-outlet>

For reference, you can view an example screenshot https://i.sstatic.net/U3PMK.png

I have also tried adding some custom CSS to the container-fluid but it didn't resolve the issue.

If anyone knows how to remove this unwanted whitespace, your help would be greatly appreciated.

Answer №1

Consider using a fluid container in this section for better responsiveness...

<div class="container-fluid">
  <app-topbar></app-topbar>
  <router-outlet></router-outlet>
</div>

For the rest of your HTML, stick to the regular layout without the fluid container.

<div class="row">
    <div class="col-sm-2">
      <nav class="navbar navbar-light bg-dark">
        <ul class="nav flex-column">
          <li class="nav-item">
            <a class="nav-link" routerLink="/admin/themes">Themes and categories creation</a>
          </li>
        </ul>
      </nav>
    </div>
    <div class="col">

      <router-outlet></router-outlet>

    </div>
  </div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to implement this design using CSS flexbox?

I'm working on designing a simple layout that looks like this: https://i.stack.imgur.com/oCzyV.png Currently, I have the following HTML structure with some variations in class names and additional markup within each element: <div class="site ...

Retrieve an array of all FormControl elements in Angular 2 and above

One of my requirements is to examine all form controls (input, textarea, etc.) within a form in order to determine their element type. With a large number of forms, I want to automate the process of assigning different default validators to each type of fo ...

What steps should be taken to enable mat-select validation?

Take a look at this link for my code. Press a button and a popup modal will appear. The validation for the "System" drop-down box does not seem to be working. When I select the "System" drop-down box, the error message fails to display when I click elsew ...

Choosing the right design strategy for an Angular2 application featuring dynamically loaded components

Within my application, the initial page allows users to choose an item from a list based on their previously saved preferences. This selection then updates the view to display the chosen functionality or page. Each of these pages has unique configurations ...

Get rid of the standard shadow located on the bottom and right of the input text field

My input fields have some border rounding and are displaying an unwanted shadow on the right and bottom. I've tried using the box-shadow property to control the width, color, and other properties of the shadow, but it's not working as expected. H ...

Implementing the 'bootstrap tour' feature in a Ruby on Rails application

I have integrated bootstrap-tour.min.css and bootstrap-tour.min.js into my project. <script type="text/javascript" src='bootstrap-tour.min.js'></script> <link rel="stylesheet" type="text/css" href="bootstrap-tour.min.css"> Her ...

Load Bootstrap tab activation

I'm having trouble getting the active class to work on my tabs. I've tried using body onload click trigger, showing tabs by ID, and many other methods, but nothing seems to be working. I have implemented hashed URLs to allow for individual tab li ...

Tips for creating a function to assign a CSS width using a JavaScript variable?

Here is the code snippet I have been working on: ...<script> function adjustElementSize() { var newSize = window.innerWidth - 600; document.getElementById("spin").style.width = newSize + "px"; document.getElementById("spin").style.height = newSize + ...

Angular - Execute a function once the observable has finished

I am currently working with a 2 part process that involves importing a list of usernames in Component 1, submitting it to a service, and then using the returned user profile data in Component 2. The issue I am facing is that when I receive the data back f ...

Aligned to the right, the ::before element stands out in the design

I have a button that already includes an ::after element below it, but I am looking to add a shape/element to the right side of the div. a { position: relative; display: inline-block; padding: 15px 10px; margin: 0 5px; color: #222; f ...

HTML5 body content and footer area

I'm working on a website with the main content area set to 95% width, but I'm facing an issue - I want the footer to be 100% width even though it's a child of the main content, which limits its width. Is there a way to make the footer overr ...

The bootstrap link transforms into a standard button

My hyperlink stops working when I include Bootstrap code, transforming into a standard button. Here's the code in question: <!DOCTYPE html> <html lang="" dir="ltr"> <head> <link rel="stylesheet" ...

What is the best way to link to this list of options?

#episode-list { padding: 1em; margin: 1em auto; border-top: 5px solid #69c773; box-shadow: 0 2px 10px rgba(0,0,0,.8) } input { width: 100%; padding: .5em; font-size: 1.2em; border-radius: 3px; border: 1px solid #d9d9d9 } <div id="epis ...

Enhancing the appearance of an Angular.js application

On the same page, there are two buttons - one for buying and one for selling. It appears that both buttons share the same HTML instance. This creates a problem when trying to style them individually using classes, ids, or other HTML-targeted selectors, as ...

Update the jQuery Mobile components on the page by refreshing them after dynamically adding them using AJAX and PHP

I have developed a PHP script that dynamically renders three form elements for each entry in a database. The script generates HTML output similar to the following example: <!-- Entry 1 --> <div data-role="fieldcontain"> < ...

What is the best way to prevent executing a method in [queryParams] in Angular 7?

I'm currently working on incorporating the option for users to open a link in a new tab. I'm trying to avoid using the (click) method, so I've come up with the following logic to achieve this: <a [routerLink]="['/search/' + sea ...

Does 1 CSS point amount to the same as 75% of a CSS Pixel?

Can anyone help clarify the relationship between CSS pixels and CSS points in modern web design? I've come across information stating that one CSS point is equivalent to 3/4 of a pixel. Is this accurate? Also, is it true that we can disregard the old ...

Changing the color of options in a list when clicked: a step-by-step guide

Here is the HTML code I have: <li onclick="switchColors()"> <a class="x" href="Faculty.php">Faculty</a> </li> <li onclick="switchColors()"> <a class="x" href="Contact.php">Contact</a> </li> And here ...

Android failing to adapt to font size changes set by media queries in HTML code

Recently, I've been facing an unusual issue on a Nexus 7 where changing the font-size on the HTML element seems to be ignored. Removing the smaller font size resolves the problem but creates new issues for phone displays. CSS: html { font-size: 10px ...

Having trouble with debugging in Chrome ever since upgrading to Angular 11?

Following the update of my angular 9.1 application to angular 11: While debugging within one of the libraries, Chrome no longer stops at my breakpoints. I am still able to debug other libraries and the app as usual. Within the troubl ...