Position filter forms on the left side to align with bootstrap cards

I'm having trouble aligning the cards using Bootstrap's row and col- classes. The first three are behaving as expected, but the fourth one isn't cooperating. Any idea why this might be happening and any solutions you can suggest?

View the issue here

This is the code snippet in question:

<div class="container-fluid">
  <div class="row">
    <div class="col-12">
      <div class="form">
        <i class="fa fa-search"></i>
        <input type="text" class="form-control form-input" placeholder="Search anything...">
        <span class="left-pan"><i class="fa fa-microphone"></i></span>
      </div>
    </div>

    <!-- Additional elements go here -->

    <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-3 col-xxl-3 boat" *ngFor="let boat of boats">
      <div class="card">
        <img src="/{{ boat.src }}" class="card-img-top" alt="{{ boat.name }}">
        <div class="card-body">
          <h5 class="card-title">{{ boat.name }}</h5>
          <p class="card-text">{{ boat.description }}</p>
          <p>{{ boat.city }}</p>
        </div>
      </div>
    </div>
  </div>
</div>

Here is the accompanying SCSS file:

.form {
  position: relative;
}

.form .fa-search {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #9ca3af;
}

/* More styles... */

.all help is greatly appreciated!</p>

.navbar-nav {
  margin-left: 35%;
}

.nav-item {
  padding-left: 20px;
}

If anyone has any insights or solutions, feel free to share them. Thank you!

Answer №1

Great beginning! Consider treating the entire width as a row - then designate col-4 for the sidebar and col-8 for your main content or right side respectively.

The fourth boat is moving because... well, there is space available! If you set the container (all boats) to be col-8 of the entire screen, you can then create flex or grids inside as desired and prevent your items from sliding outside of the defined space - they will wrap down, move below the first card, or enable you to create an infinite horizontal scroll with all boats visible in one row.

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

Angular: Variable `app` has not been defined

I am working on a simple MEAN stack app and it is almost up and running, but I encountered an uncaught reference error when it tries to redirect to the index page. The server seems to be running fine and the browser displays "Loading..." as expected on the ...

Custom field data in WordPress

I'm having difficulty formatting the prices of certain products using a custom field (unit_price). The value is 3.2, but the code only displays 3 because it doesn't recognize commas or dots. Is there a way to display the full value? any assistanc ...

Is it better to define the SVG `viewbox` once in a `symbol`, or each time an SVG is `used`?

Based on my research, some tutorials suggest that when inserting an SVG <symbol> with <use>, the viewBox property only needs to be defined once - in the <symbol> tag. While this method seems to work fine, it results in the contents of th ...

Troubleshooting issues with Bootstrap 4 navbar dropdown functionality

I recently added a test page, but when clicking on the links, they do not direct you to the album page as intended. Instead, the page blinks and jumps quickly. To see this issue in action, visit the live test page through this link. <!DOCTYPE html>&l ...

Binding HTML Elements to JavaScript Values

Currently, I am working on a project with .Net and Vue. However, I am facing an issue in binding a value in a label. <li v-for="restaurant in vHolidays.data" > <form id="1"> <div> ...

What steps can be taken to resolve the issue of the Cannot POST /index.html error?

Here is an example of a calculator app created using HTML and Javascript. Upon running the program with nodemon and accessing localhost:3000, pressing the submit button triggers an error on Google Chrome. [nodemon] starting `node calculator.js` Server sta ...

I continue to encounter an error every time I attempt to place an HTML nested div on a separate line

When I structure the HTML like this, I don't encounter any errors: <div class="game-card"><div class="flipped"></div></div> However, if I format it differently, I receive an error message saying - Cannot set property 'vi ...

Define the state of an object using Parent and Children classes following the application of a filter

Within Angular 8, I am dealing with an Observable: let parents: Observable<Parent[]>; The classes Parent and Child are defined as follows: class Parent { id: number; name: string; children: Child[]; } class Child { id: number; name: str ...

Booking form pop-up appearing beneath the section

Currently, I am in the process of adding a booking form to the main page of . However, I seem to be encountering an issue where a popup appears below the section it is supposed to open within when selecting the number of persons. Despite adjusting the z ...

Is it necessary for me to employ MetaTag http-equiv in conjunction with DTD XHTML 1.0 Transitional//EN?

Currently using Asp.net for my project. In the document, I have included the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I am wondering if it is necessary to a ...

What steps do I need to take to activate the legacy policy API for Google login?

The Legacy People API has not been utilized in project 145315848075 or it is currently disabled. To enable it, please go to and then attempt again. If you have recently activated this API, please wait a few minutes for the changes to take effect before ...

Dropdown menu will appear when you click on one of the menu items

Can someone help me create a dropdown menu using a JavaScript function that toggles on click? I've attempted to do so with the following code, but it's not working as expected. Could you please point out where I might be going wrong? I'm loo ...

What causes the card to exceed the boundaries of its parent column?

My Form elements seem to be misaligned and not fitting correctly. .h-100 is used for the blue navigation background to occupy the full height of the screen. An answer explaining why my code snippet is not working would be appreciated. View Plunker here ...

Is it possible for iText 5 to convert PDF files into HTML format?

My latest project involved using iText 5 to generate a visually appealing report complete with tables and graphs. Now I'm curious to know if iText also has the capability to convert PDF files into HTML format. If it does, how would one go about doing ...

Troubleshooting CSS navigation bar hamburger dilemma

Currently, I am facing an issue with a toggle button on my website. When I click on the hamburger menu, the navigation bar does not show up even though the toggle feature is working perfectly fine. I have tried combining different sources to solve this pro ...

Having trouble with input functionality on iPad due to a CSS, LI, div, or clipping issue?

One challenge I am facing is related to several inputs housed within an LI and div that are sortable using jQuery. The problem arises specifically on the iPad when attempting to click into the inputs to enter information - there is no caret appearing, ren ...

Applying ngClass to handle positive and negative numbers and adjust color in Ionic/Capacitor

I have data from my API that includes price and percentage data. I want to display negative numbers in red, and zero or positive numbers in green. After exploring Angular documentation, I found that ngStyle and ngClass can be used for this purpose. I chose ...

Can a container be sized based only on the width of one of its children?

Take a look at this snippet of html: <div class="container> <div class="header"> </div> <div class="content"> </div> <div class="footer"> </div> </div> I am aiming for the containe ...

What causes the unexpected behavior of JQuery's .animate() function?

I am currently working on a project that involves creating a div element for the purpose of dragging and dropping files. My goal is to have the height of the div increase when a file is dragged into it, and decrease when the file is dragged out. To achiev ...

Show me how to customize the default confirmation box using just CSS!

Is it possible to style the standard window.confirm using only CSS without any additional JavaScript code? If so, how can this be achieved? ...