Can someone help with the issue where the CSS field position changes when the "X" icon appears, as mentioned in the title? I am looking for a solution to fix this problem

https://i.sstatic.net/Cj8Bm.pngWhen trying to add an additional field on a page, the "X" icon appears inline with the field and causes the other fields to adjust their position. However, I want the new field to remain in the same position as the title. How can I achieve this while keeping the "X" icon on the same line?

CSS

[
.account-csv-field {
  display: flex;
  align-items: center;
  min-height: 2.8rem;
  &.all-edit-disabled { height: 1rem; }
  .ie-field {
    margin: 0 0.1rem;
    height: 2.8rem;
    &.ie-user {
      flex: 1;
      max-width: 13rem;
    }
    &.ie-password {
      flex: 1;
      max-width: 13rem;
    }
    &.ie-comm-plan {
      flex: 1;
      max-width: 13rem;
    }
    &.ie-model {
      flex: 1;
    }
    &.ie-option {
      flex: 1;
      width: 12px;
    }
  }
.ie-close-button {
    font-size: 20pt;
    margin-left: 0.5rem;
    cursor: grab;
  }]

HTML

<nc-select
      v-if="!account.fromCsv || (initialErrorState.option && !forceEditDisable)"
      class="ie-option ie-field"
      :value="account.option.value"
      :options="options.map(c => c['option'])"
      :error-popup="errorState.option"
      :disabled="options.length < 1 && !account.option.value"
      :required="options.length > 0"
      :error-without-interaction="account.fromCsv"
      @update:value="updateIssuing('option', $event)">
    </nc-select>
    <el-tooltip v-else :content="errorState.option" :disabled="!errorState.option" placement="top" effect="light">
      <span :class="{ 'static-error': Boolean(errorState.option) }" class="cell-option">{{ account.option.value }}</span>
    </el-tooltip>
    <i
      class="el-icon-close ie-close-button"
      v-show="removable"
      @click="$emit('remove')"></i>

Answer №1

To achieve the desired result, apply the CSS rule position:absolute to the element with class .ie-close-button, and set its parent's DOM element to have a position:relative. This will allow you to adjust the position of the close button as needed using the left and right properties.

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

Use PHP to highlight the row that has been selected in an HTML table

I am currently working on a project where I have styled multiple HTML tables on my website using alternating gray and white bands. Now, my goal is to highlight the selected row in a darker shade of gray. I have experimented with various solutions, and the ...

Mastering Vue 3: Simplifying a reactive array of objects while maintaining reactivity

Struggling with maintaining reactivity in Vue 3 when flattening a nested array of objects. Unfortunately, my attempts result in crashing and browser hang-ups. In my Vue 3 component, I have an array structured as a list of objects: this.grouped = [ ...

What is the best way to cut off multiple lines of text and display the remaining strings at the

Currently, I am working on a project that involves implementing a gallery feature. The challenge lies in displaying file names which can be quite lengthy, and we are restricted to showing only 2 lines of text. While this can be achieved using line clamp an ...

What is the best way to remove the help button on the WordPress dashboard?

Being a beginner in Wordpress, I am trying to figure out how to hide the help button on the top right of the dashboard in the admin backend without resorting to plugins or code removal. My plan is to simply add display:none to a CSS file, but I am having ...

Steps for implementing overflow scroll on a div with an unspecified height

The layout I'm working with looks like this: .page { width: 360px; height: 704px; border: 1px solid red; } header { height: 10%; width: 100%; display: flex; align-items: center; justify-content: center; background-color: lightblue; } ...

Equalizing the space between table headings and content

I am struggling with aligning the heading and entries in my table properly. https://i.stack.imgur.com/IYtY1.jpg My goal is to ensure that the heading and entries are perfectly aligned with each other. This is how my Table.jsx looks like: <div classNa ...

Slideshow plugin glitch on Safari and Opera caused by jQuery implementation

My current project involves utilizing a fantastic plugin called Sequence.js for creating animations and transitions with CSS3 based on jQuery. I have set up a simple responsive fadeIn-fadeOut slideshow using this plugin. While everything works smoothly an ...

The Jquery image on.load event seems to only function properly after performing a manual hard refresh of

Looking for a solution to replace loading text with a button only after the image has loaded onto the page. Utilizing on.load as follows: $('img.house').on('load', function() { $('.loading').hide(); $('# ...

What is the process for sending a POST request from a plain JavaScript application?

I've developed a stand-alone webpage named index.html that includes a basic form with an input field. Every time I attempt to submit the form by clicking the button, I intend to send a POST request to my server. Unfortunately, the browser keeps displa ...

Adjusting the dimensions of a rectangle using jQuery: A step-by-step guide

I am encountering an issue while attempting to adjust the width and height of a rectangle using jQuery. The error message I receive is "Uncaught TypeError: Cannot read property 'scrollWidth' of null" Below you can find the code snippet in questi ...

A HTML table featuring a horizontal scroll and cells with a fixed width for optimal visibility

Seeking assistance with creating an HTML table with a horizontal scroll and fixed cell width. I have managed to implement the horizontal scroll feature using the code below, but struggling to adjust the cell widths. Any tips or suggestions would be greatly ...

The error message says: "VueComponent.filterKategori function cannot read property 'filter' because it is undefined at line 16260 in app.js."

this is the code snippet that I'm dealing with: computed: { filterKategori() { var kategori = this.kategori.data.filter(f => { return f.induk == null && f.id_klasifikasi == this.id_klasifikasi; }); return kat ...

Troubles with CSS in MUI Component Integration

How can I successfully implement a vertical timeline using Material UI in React? I've set it up, but the CSS isn't functioning as expected. Is there an error in my implementation? List of Dependencies: "@emotion/react": "^11.11.1& ...

Error: Attempting to access index '0' of an undefined property in firebase and vuex

When using a vuex action to upload an image to Firebase and save the URL, everything seems fine until trying to retrieve the downloadUrl and adding it to the meetup database reference. The code I have looks like this: actions: { createMeetup ({commit ...

Initial load hook for Vue applications

Our application features a loader that is designed to appear during the initial loading process. To address this, I decided to integrate it into the 'mounted' hook of the layout because all pages utilize the same layout. I'm now questionin ...

The Vue component fails to display the updated data even after the prop data has been modified

This is the parent component called abc.vue <v-card outlined class="mt-4"> <DetailsTable v-show="toggleClientData" :columnDefs="columnDefs" :rowData="rowData" /> </v-card> methods:{ aggridData() { let self = this; th ...

Implement Vue router (version 4) in a vanilla .js file within the Quasar framework (version 2) for seamless navigation and

I'm attempting to access the router from a plain .js file within a Quasar project but I am encountering difficulties. In my search on how to achieve this in Vue, I found that people typically import the Router object from /src/router/index, like so: i ...

the sizing issue with three div elements

I am attempting to create 3 parallel divs in HTML. The middle div should be exactly 960px wide and centered on the page, with the left and right divs positioned on either side. The minimum width of the page is set to 1024px. When the browser width exceed ...

Space between Logo Header and Navigation Bar

Recently, I attempted to create a new header with a responsive logo and menu. After seeking guidance from StackOverflow experts, everything seems to be functioning correctly now. However, I am facing an issue regarding the gap between the header and navba ...

Tips for showcasing a "loading" animation as a lazy-loaded route component loads

Utilizing webpack's code splitting feature, I have divided my application into multiple chunks to prevent the entire bundle from being downloaded at once when a user visits my website. Some routes require large chunks that may take some time to downl ...