Having trouble getting Bootstrap 5 to work with a position-relative row?

I am having trouble placing the * sign on the left side. Whenever I try to do so, it only works if I remove the row class.

<!doctype html>
<html lang="fa" dir="rtl">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link href="{{ asset('themes/fontawesome/css/all.min.css') }}" rel="stylesheet">
</head>
<body>
    <div id="showFilters">
    <div class="position-relative row">
    <i class="fas fa-times text-danger position-absolute end-0"></i>
    <div class="col-md-4 mb-3">
    <label for="name" class="form-label">نام فیلتر</label>
    <input type="text" id="name" class="form-control" name="filters[1][name]">
    </div>
    <div class="col-md-4 mb-3">
    <label for="latin" class="form-label">نام لاتین فیلتر</label>
    <input type="text" id="latin" class="form-control" name="filters[1][latin]">
    </div>
    <div class="col-md-4 mb-3">
    <label for="field" class="form-label">انتخاب فیلد</label>
    <select id="field" class="form-select" name="filters[1][field]">
    <option value="1">چک باکس</option>
    <option value="2">رنگ</option>
    <option value="3">آپشن</option>
    </select>
    </div>
    </div>
    </div>
</body>
</html>

https://i.sstatic.net/VoMHr.png

Answer №1

Remember, only columns should be the direct children of a row, with content placed inside the columns rather than directly in the row itself.

<div id="showFilters">
    <div class="position-relative row">
        <div class="col-md-4 mb-3">
            <i class="fas fa-times text-danger position-absolute start-0"></i>
            <label for="name" class="form-label">Filter Name</label>
            <input type="text" id="name" class="form-control" name="filters[1][name]">
        </div>
        <div class="col-md-4 mb-3">
            <label for="latin" class="form-label">Filter Latin Name</label>
            <input type="text" id="latin" class="form-control" name="filters[1][latin]">
        </div>
        <div class="col-md-4 mb-3">
            <label for="field" class="form-label">Field Selection</label>
            <select id="field" class="form-select" name="filters[1][field]">
                <option value="1">Checkbox</option>
                <option value="2">Color</option>
                <option value="3">Option</option>
            </select>
        </div>
    </div>
</div>

Codeply Link

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

Combination of written content and mathematical equations displayed on an HTML webpage

I've been tasked with creating something similar to the following on an HTML page: The math tag in HTML is not suitable because it struggles with handling the line break between parts "/begin()-/end()". To achieve the desired effect (succes ...

How to remove an image input type using jQuery

Can anyone provide insight into the issue with these scripts? I am attempting to remove an input when it is clicked. The input is of type image, so CSS cannot be used. I have tried using JavaScript but it doesn't seem to be working. HTML <!doctyp ...

Is there a way to make a TABLE expand to match the height of its surrounding element? (or, tackling sluggishness in IE with JavaScript)

I am facing a challenge with a web page where I have a table nested inside of a TD tag. Despite the unconventional approach, I need to ensure that the height of the nested table matches the height of the TD cell containing it upon page load. Currently, I a ...

Conceal and reveal buttons at the same location on an HTML webpage

There are 3 buttons on my custom page called page.php: <input type="submit" value="Btn 1" id="btn1"> <input type="submit" value="Btn 2" id="btn2" onClick="action();> <input type="submit" value="Btn 3" id="btn3" onClick="action();> ...

Tiny buttons with toggle functions in Bootstrap 5 using btn-check and btn-sm classes

Is there a way to make the buttons smaller using the btn-check class along with btn-sm? Currently, it seems to be ignoring the small class. Any guidance on how to achieve smaller buttons? <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/ ...

Identifying text within clicked divs using identical ids

$(document).ready(function(){ $('#peoplelayer').click(function(){ $(this).fadeOut(500); var str = $(this).text(); alert(str); }); }); This is code where I use the same id "#peoplelayer" for all the divs. When on ...

Check if the input value was chosen by pressing Enter instead of clicking on it

There is an input tag with the following attributes: <input type="text" name="cOperator" class="form-control scale-input operator" placeholder="Enter your ID" autocomplete="off" onkeyup="ajax_showOptions(this,'getEmp',event)" required> ...

Maintaining Order with SCSS and Compass - Is it Possible?

Does compiled SCSS using Compass preserve the order of declarations? Can Compass guarantee the order of properties (assuming it's the way Compass operates that determines this)? This is mainly important when there are multiple definitions with the s ...

Ways to decrease the space between lines of text within a single mat-option element

https://i.sstatic.net/Sr1cb.png ::ng-deep .mat-select-panel mat-option.mat-option { height: unset; } ::ng-deep .mat-option-text.mat-option-text { white-space: normal; } Currently, I have implemented this code to ensure that text in options wraps to t ...

Showing the value of a JavaScript variable within an HTML input field

Here is an interesting HTML structure that includes a list and input field: <li> <span>19</span> </li> <li> <span>20</span> </li> ...

Unable to extract text input from form

When designing a form for users to change their password, I encountered an issue where passing 3 empty Strings instead of a User object resulted in the Strings being returned as empty when submitting the form. Is there a way to retrieve String values from ...

What is the best method for automatically closing the modal window?

I implemented a modal window on my website. Within the modal, there is a green button labeled "Visit" which triggers the "Bootstrap Tour". I aim for the modal to automatically close when the tour starts. To access this feature on my site, users need to ...

Error retrieving resource: server returned a 404 status code indicating file not found for javaScript and CSS files

I can't seem to get my css and js files to load on the server. Here is how my file structure looks like: GAME_Folder https://i.sstatic.net/wzfB3.png HTML doctype html head link(href='https://fonts.googleapis.com/css2?family=Press+Start+2P& ...

Steps for Embedding an HTML Page into a Tab using jQuery

Within the tab labeled class=plots-tabs-heatmap, I am attempting to insert a new page using the code below. However, instead of seeing tmpdata/page2.html displayed on the tab, nothing appears. $('#plots-tabs-heatmap').html("tmpdata/page2.html"); ...

Tips on creating a Django query based on user-selected options from a drop-down menu

As a newcomer in an internship role, I have been tasked with creating a website where users can select a program, location, or theme to visualize on a heatmap. To achieve this, I opted to utilize Django. However, I am facing two challenges: Firstly, my M ...

What is the proper syntax for using .focus() with the nextElementSibling method in typing?

As I strive to programmatically shift focus in my form using nextElementSibling, I encounter a challenge with typing variables/constants due to working with Typescript... I have managed to achieve success without typing by implementing the following: myF ...

Explore the Shopify assistance on the secondary blog section within a separate page

Hey there, I'm looking for someone who is familiar with Shopify and can assist me. I am currently trying to set up a secondary Blog section on a separate page from my default 'Blog Page', but I'm encountering issues in displaying the a ...

Using setTimeout to click and hold on an element in Javascript

I am in need of adding a feature to my web app where a specific action is triggered when the user clicks and holds on an element, similar to the long press on Android. Here is the HTML code for my div: <div id="myDiv" onmousedown="press()" onmouse ...

Initiate the React application with the given external parameters

I have created a React app that is embedded within a webpage and needs to start with specific parameters obtained from the page. Currently, I am passing these parameters in the index.HTML file within a div element. The issue arises when these parameters ar ...

What could be causing an unidentified term to be included in the Vue SCSS compilation process

In my Vue application with TypeScript, I encountered an error during compilation that reads as follows: Failed to compile. ./src/style.scss (C:/../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!C:/.../node_modules/vue-loader/lib/loaders/stylePostL ...