Positioning one div beneath another div

As a newcomer to the world of web development, I'm struggling with alignment in my project. Specifically, I have an issue with the features area - every time I add it, it appears above where I want it, below the search bar and image. View example

Here is the code snippet causing me trouble:

<body>
      <div class="wrapper">
        <div class="sidebar">
          <h2>Database</h2>
            <ul>
              <li><a href="#"><i class="fas fa-home"></i>Home</a></li>
              <li><a href="#"><i class="fas fa-user"></i>Search</a></li>
              <li><a href="#"><i class="fas fa-address-card"></i>Add</a></li>
              <li><a href="#"><i class="fas fa-hospital-alt"></i>Centers</a></li>
            </ul> 
        </div>
        <div class="main_content">
          <form>
            <div class="inner-form">
              <div class="input-field first-wrap">
                <div class="input-select">
                  <select data-trigger="" name="choices-single-defaul">
                    <option placeholder="">Blood Types</option>
                    <option>0</option>
                    <option>A</option>
                    <option>B</option>
                    <option>AB</option>
                  </select>
                </div>
              </div>
              <div class="input-field second-wrap">
                <input id="search" type="text" placeholder="Blood Quantity" />
              </div>
              <div class="input-field third-wrap">
                <button class="btn-search" type="button">Search</button>
              </div>
            </div>
          </form>
        </div>
        <div class="container py-5 my-5 z-depth-1">
          <section class="p-md-3 mx-md-5 text-lg-left">
            <h2 class="font-weight-bold text-center mb-5 pb-3">Features</h2>
            <div class="row text-center d-flex justify-content-center">
              <div class="col-lg-3 col-md-6 mb-lg-0 mb-5">
                <i class="fas fa-map-marker-alt fa-3x indigo-text mb-4"></i>
                <h4 class="font-weight-bold mb-4">Feature 1</h4>
                <p class="text-muted px-2 mb-lg-0">
                  Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                </p>
              </div>
            </div>
          </section>
        </div>
      </div>
      <script src="js/extention/choices.js"></script>
        <script>
          const choices = new Choices('[data-trigger]',
          {
            searchEnabled: false,
            itemSelectText: '',
          });
    
        </script>
    </body>

Any assistance would be greatly appreciated! :D

Answer №1

To incorporate the image, insert it into the HTML code and assign the properties float:left; width:100%; to the container surrounding both the search element and the image.

If you opt for utilizing the image as a background in the CSS style sheet, this approach will not be feasible.

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

Transforming a pseudo element from horizontal to vertical orientation

I have a unique snippet of code that generates an element at the bottom of a div to serve as an inventive 'arrow/pointer' pointing down. Now, I am seeking assistance in tweaking the script so that the 'arrow/pointer' directs towards th ...

The size of the search input and textarea in HTML decreases when viewed on an iPad device

Currently utilizing Bootstrap 3 and AngularJs for this project. Implementing the following markup for the input field with type 'search': <input type="search" class="form-control" id='roomSearch' placeholder="Search" ng-model=&apo ...

Steps to set Option one as the selected value following a click event or an onClick function:

I'm having trouble getting this code to change the default option value! JS <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script type="text/javascript"> function updateDefa ...

conceal any externally-provided iframes

There's an iframe on our page causing a display problem, even after attempting CSS modifications. Is there a way to use jQuery to hide an externally loaded iframe? We tested the document ready function, but it seems that the external JavaScript file ...

Data not getting transmitted to Rails controller via AJAX request

My development setup includes Rails 5.2.4, coffee-rails 4.2, jquery-rails 4.4.0, and jquery-ui-rails 6.0.1. I've successfully implemented functionality that allows users to drag around and resize divs on a web page. However, I now need to save the ne ...

Inquiries regarding jQuery's functionality and efficiency

I was wondering about the best way to improve performance? Would it be more efficient to have two images written in HTML, one visible and one hidden, and then use jQuery to toggle their display (hiding the visible one and showing the hidden one)? <img ...

Creating visually pleasing HTML emails with uniform table data heights

Struggling with Outlook while designing an HTML template. My row has 2 td elements with different content, and setting equal heights is proving to be a challenge. The fixed height on the td causes issues when switching to mobile view in Outlook as text wra ...

Navigating through cpanel to interact with a Button using Selenium in Python

Unable to select the new folder option. Here is what I have attempted: driver.find_element_by_id("li.action-newfolder") driver.find_element_by_xpath("//[a(text(), 'New Folder')]").click() Unfortunately, neither of these methods are successful. ...

Tips for prolonging the visibility of the Bootstrap 5 Toast alert

Within my HTML code, I have defined a toast element: <div class="position-fixed top-0 start-50 translate-middle-x" style="z-index: 9999"> <div id="errNeutralAlreadyExists" class="toast fade bg-solid-white&quo ...

What is the best way to insert a text input with variable width into a table?

I am currently using twitter-bootstrap and have encountered an issue with two tables. The first table can be viewed here: http://jsfiddle.net/MELUd/ <table class="table table-bordered"> <thead> <tr> <td colspan ...

Purge the external CSS files

Scenario In my React Router setup, most pages include their own .css files along with the default antd (UI framework) stylesheet: import '../styles.css'; This ensures that all components inherit these styles automatically. Issue at Hand Now, I ...

The HTML table printout is missing cells in the first column

Encountered a strange issue with Internet Explorer and Chrome involving a basic HTML table. The table has no layout CSS, 2 columns, no styles, and its width is set to 100%. When attempting to print the table in these browsers, the first cell on the second ...

Switching Bootstrap Navbar Active State with JavaScript

I have encountered an issue with using the "active" class on my navbar navigation items in Bootstrap 4. When I click on the links, the active state does not switch as intended. I have tried incorporating JavaScript solutions from similar questions but have ...

Instructions for creating a distinct click listener for each <img> element inside a table cell

Within my table, each row contains multiple columns with images as data. I successfully implemented a 'common listener' that is triggered when any image within a table row is clicked. $('#mytable tbody td img').click(function () { // ...

Trouble arises when Bootstrap modal fails to display for IDs exceeding 1000

I'm facing an issue with a table that has hundreds of rows. I have assigned a td tag with a modal, but I've noticed that the modal doesn't show up when the id is greater than 1000. Here is how I've set up my data target in the td tag: & ...

Handling click events for parent and child elements in Angular 5

In Angular5, Below is the code I am working with: <div (click)="abc()"> some content <button (click)="xyz()">Click</button> </div> When I click on the button, both methods are being called. I want only a sin ...

The overflowing pop-up container

When I trigger a popup that dynamically generates a fixed background with a centered dialog, it works well. However, on smaller monitors like laptops, tablets, and phones, the content can overflow beyond the visible area due to its fixed container, making ...

Implement a transition effect for when elements change size using the `.resizable().css` method

I attempted to incorporate a deceleration effect when resizing an element back to its original size using the resizable method. The slowdown effect should only trigger during the click event (when the "Click-me" button is pressed), not while manipulating ...

The implementation of display flex is causing issues with the material-ui grid layout

Struggling to implement the grid system from material-ui due to an issue where grid items do not resize when resizing the browser window. The culprit seems to be a parent div with the style property "display": "flex". The dilemma arises from using a mater ...

Is it possible to apply CSS based on a component's displayName?

Are you a CSS pro? I'm attempting to apply a class that will make all descendants of an element read-only, but for some reason the style isn't being applied as expected: #ComponentDisplayName * { -webkit-user-select: text; -moz-user-sel ...