What is the best way to place a row with a width of 25% at the conclusion of the row?

I utilized https://i.sstatic.net/aQ6Ew.png

by implementing this code.

<div class="row mw-md-100 d-flex w-25 justify-content-end mb-2" >
  <div class="col-md-12">
    <nb-select
      fullWidth
      class="mw-md-100 mb-md-3 mb-2"
      placeholder="User Name"
    >
    </nb-select>
  </div>
</div>

Nevertheless, I'm in need of relocating this to the end of the row rather than the beginning. How can I achieve this?

Update: The solution is as follows:

<div class="row mw-md-100 d-flex w-100 mb-2 justify-content-end ">
  <div class="w-25 advanced-filters">
  <div class="col-md-12 " >
    <nb-select fullWidth class="mw-md-100 mb-md-3 mb-2" placeholder="User Name" [formControl]="selectedSiteFormControl">
    </nb-select>
  </div>
</div>
</div>

Change background color of the second div

    .advanced-filters {
      background-color: #222b45 !important;
    }

Answer №1

To achieve this, you can keep the row at a width of 100% and assign the w-25 class to the col, then apply the flex-row-reverse class to the row.

<div class="row mw-md-100 d-flex flex-row-reverse mb-2">
  <div class="col-md-12 w-25">
    <nb-select
      fullWidth
      class="mw-md-100 mb-md-3 mb-2"
      placeholder="User Name"
    >
    </nb-select>
  </div>
</div>

Answer №2

If you prefer, you can position yourself to the right

<class="row mw-md-100 d-flex w-25 justify-content-end mb-2">
  <div class="col-md-6">somewhere else here</div>
  <div class="col-md-6">
    <nb-select
      fullWidth
      class="mw-md-100 mb-md-3 mb-2"
      placeholder="User Name"
    >
    </nb-select>
  </div>
</div>

Alternatively, you could include float: right within

<div class="col-md-12" style="float:right">

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 causing the floated element to overlap the element below instead of vice versa?

div { background-color: #00FFFF; } p { width: 50px; height: 50px; border: 1px solid black; margin: 0px; } #p1 { background-color: red; float: left; } #p2 { background-color: green; } #p3 { background-color: orange; } #p4 { backgr ...

By default, the text area element in Vue or Nuxt will send a message to the console

Every time I include a textarea html element in my Vue/cli or Nuxt projects, this message appears in the console. Is there a way to prevent this message from showing up in the console? <textarea rows="5" cols="33"> This is a textarea. < ...

Ways to align page title text at the center of the banner image without using flexbox or grid layout?

Seeking advice on how to vertically center the banner text in the middle of the banner image for a CSS-only psd conversion project. Any ideas on achieving this goal without utilizing flexbox or grid? header { background-image: url(../assets/main-ban ...

Lines of text suddenly appearing in HTML email messages on Outlook 2016

We have been utilizing Mailchimp to design simple email templates, exporting the code, and using it with other clients. However, we are encountering random lines under certain tables and between them. I have attempted to address this issue by adding a blac ...

Duplicating the design of a Bootstrap 5 button for a label

Due to certain requirements, I have the necessity for my buttons to use <labels class="btn"> instead of the usual <button>: <label for="fileinput" class="custom-file-upload btn btn-primary"><i class=" ...

The font color fails to change when hovering over

I'm experiencing an issue with the styling of my input box. When the user starts typing, a div containing a list of possible clubs is displayed. Currently, I am having trouble with the .clubLink:hover class and its background color. CSS: <style& ...

My redirect is being disrupted by passing a text string with new lines through GET requests

My issue involves submitting a form that utilizes JavaScript to pass a value through GET. Upon reaching the submission page, the function runs successfully, but when redirecting via the header, it ends up on a blank page. The header code for redirection lo ...

The value of the checkbox with the `on` attribute is not being passed to the Action class. Should I retrieve the parameter directly from

When submitting a form to my action class using the classic getter/setter method with Struts 2, all fields receive their values except for a boolean field which remains false even after checking the corresponding checkbox. Here is an example of the checkb ...

Can you tell me the CSS equivalent of the SASS/SCSS expression "&$"?

Hey there! I've been diving into the world of Material-UI components and stumbled upon this interesting styling snippet: root: (0, _extends3.default)({}, theme.typography.subheading, { height: theme.spacing.unit * 3, boxSizing: 'content- ...

Unexpected behavior exhibited by form in response to CSS styling

When I try to adjust the values of left, top, and right, nothing seems to change. I also experimented with the position attribute without any success. What could be the mistake on my end? .PHP_A { position: static; left: 200px; top: 400px; righ ...

Achieving Vertical Tabs on Larger Screens and Horizontal Tabs on Smaller Screens with Css Bootstrap 4

I'm attempting to create tabs that are vertical on wider screens and horizontal on smaller screens, but I'm unsure of how to accomplish this. I have experimented with adding flex-md-column and flex-lg-column to the nav tabs: <ul class="nav na ...

Using Jquery fadeIn along with responsive CSS media queries

Issue at Hand: An issue arises with my navigation bar and text block animations. The fading effect applied on the text element causes inline styles to be added, thus disrupting the media query set to hide the text on smaller screens. If you disable the s ...

Obtaining the height of a jQuery element after it has been appended to another div may result in

I am struggling to make a div scrollable only when it reaches a certain height after adding text to it. The jQuery code I wrote to check the height keeps returning zero. Can anyone offer guidance or suggestions? HelpOverlay.prototype.buildContent = functi ...

Is there a way to have the menu displayed on a single line and consistently centered?

I am working on a menu that needs to stay centered at the top of the screen, with a consistent appearance and just one line, regardless of the screen width. However, I'm encountering an issue where the menu mysteriously transitions into a two-line for ...

How can you create a blurred effect on a navbar?

Looking to achieve a unique blur effect in the background of my navbar component. The standard CSS blur effect isn't giving me the desired result, so I'm seeking some guidance on how to customize it. For example: https://i.sstatic.net/bPEXZ.png ...

Customize your Outlook emails with HTML and CSS to right-align content for a polished look

My current project involves generating a report to be sent via email, with Outlook being the mandatory application in our system. The report's content is HTML-based and utilizes a table layout. Part of the content needs to appear right-aligned within ...

The issue of CSS transitions flickering in Internet Explorer

Can someone help me troubleshoot an issue with this code in Internet Explorer? CSS: .nav-fillpath a { width: 100px; height: 100px; position: absolute; display: block; bottom: 0%; left:0; right:0; color: #3e3e3e; margin ...

Tips and tricks for implementing vuetify tooltips within a list component

Looking for help with my code: <div id='app'> <v-app> <v-list-tile-content> <v-list-tile v-for="(item, index) in items" :key="item.id" > <v-list-tile-action> {{index+1}}. </v-list-tile-action> < ...

centered table within a container with vertical alignment

I'm having trouble centering a table vertically in a div. I've tried using vertical-align but it's not working for me. Can anyone suggest a solution to place it at the top of the div? <div class="col-12 d-flex"> <div c ...

Utilize jQuery to animate the concealment of elements in my sidebar

On my webpage, there is a sidebar that behaves in a specific way when the browser is resized. Items are only displayed if they are able to fit within the visible portion of the window. This functionality can be seen in action on the jsFiddle provided. htt ...