Tips for adjusting the size of a v-text-field within a d-flex layout in Vue

I'm a beginner with Vue and I have encountered an issue with two v-text-field elements in a flexbox. They are currently taking up the entire available space on a line when displayed side by side. However, I would like to make them smaller. Despite trying to add a style to modify their width, it doesn't seem to be working as expected. I suspect that the style is being overwritten somewhere. Below is my code for the template and style:

 <div class="selector pa-3 pt-0">
       <div class="d-flex justify-space-between align-center py-2">
        <v-text-field
          outlined
          dense
          clearable
          hide-details
          class="textbox"
        />
        <v-text-field
          outlined
          dense
          clearable
          hide-details
          class="textbox"
        />
      </div>
 </div>

Below is the <style> section of the code:

<style scoped>
  .selector {
    position: sticky;
    z-index: 1;
    padding-top: 12px;
    top: 0px;
    background-color: white;
  }
  .textbox {
    width: 30px;
  }
</style>

If anyone has any suggestions or solutions, they would be greatly appreciated!

Answer №1

To achieve the desired result, simply replace 'width' with 'max-width'

.textbox {
    max-width: 30px ;
  }

For a live demonstration, you can visit this link on CodePen.

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

Trouble with vertical alignment and height in a floating division

After scouring through numerous discussions on Stackoverflow regarding vertical alignment and 100% height issues, we have not found a solution. Some of the topics we explored include: Vertical-align middle not working in CSS How to fill height of a float ...

Attempting to modify PHP query following submission of data via Axios in Vue application

Fetching a JSON object through a PHP query from a service known as BullHorn can be done like this: <?php echo getBhQuery('search','JobOrder','isOpen:true','id,title,categories,dateAdded,externalCategoryID,employmentTy ...

The React Material UI table is having trouble stretching to fill the space

Currently, I am experimenting with developing my own virtualization technique using a different approach than react-virtualized. However, I am encountering difficulties when it comes to styling. I have come across an issue where the material table in the ...

Add a color gradient to text as it animates without displaying any code tags (HTML, CSS, JS)

I have a unique text animation that loads when the page loads. The characters will be gradually written to the screen with some words having a gradient effect. While I've managed to successfully apply the gradient, there seems to be a pause when it re ...

Tips for achieving content-width while employing the 'grid' display property?

Here is a specific container I am working with: #containerDiv { display: 'grid' grid-template-columns: 'repeat(6, auto)' } The issue I am facing is that the children within the container are taking up more space than their actual w ...

Do frameworks typically result in redundant CSS declarations?

Working on my latest Wordpress theme project, I have integrated the Bootstrap framework. One of the styles included in the Bootstrap CSS file is: input, textarea, .uneditable-input { width: 206px; } This style rule is causing issues with how my search ...

Troubleshooting: WordPress post not uploading to custom PHP file - Issue causing ERROR 500

Our website is built using WordPress, and I was tasked with adding a function to our newsletter subscription that sends an email to a specific address based on the selected value in the form. Everything was working perfectly on my local host, but when I tr ...

An issue arises in VueJS when employing brackets and the replace function in Typescript

My journey with the Typescript language has just begun, and I am excited to dive deeper into it. Currently, I am working on a SPA-Wordpress project as a hobby using Vite (VueJS). However, I am facing some challenges with the syntax when transitioning from ...

What is the best way to confine a child div with a dynamic height?

Upon initialization of Jwplayer, a class is injected with the following CSS: .jwplayer.jw-flag-aspect-mode { height: auto !important; } Here's my code snippet: <div style="height: 80vh; width: 100%"> <div style="height: 90%; width: 100 ...

Enter information to accompany your images in the description box

After browsing through numerous websites tonight, I stumbled upon this code. My goal is to create a photo upload page on Google Drive and set up a dropbox for it. I'm facing an issue where the information inputted into my placeholder box (city and ye ...

Different floating divisions that are tightly packed adjacent to each other

I'm dealing with dynamically created divs that have variable content, all following the same CSS rules. My goal is to organize them into 2 columns without any space in between. I attempted to use float: left/right, but there still remains space at the ...

Transfer groups between divisions

In my HTML structure, I have two main divs named Group1 and Group2. Each of these group divs contains at least two inner divs, all with the class .grp_item. Currently, the grp_item class is set to display:none, except for one div in each group that has a c ...

Using an external JavaScript script may encounter difficulties when loading pages with jQuery

Trying to utilize jQuery for loading html posts into the main html page and enabling external scripts to function on them. Utilizing a script (load.js) to load posts into the index.html page: $(document).ready(function () { $('#header').loa ...

Position the brand logo in between the left and right navigation menus using Bootstrap 4

<nav class="navbar-toggleable-sm" role="navigation"> <div class="container justify-content-center"> <div class="navbar-brand navbar-brand-centered">Brand</div> <ul class=" navbar-nav float-left"> ...

What is the best way to store selected items from a multi-select box in AngularJS that is generated using ng-repeat?

I have a scenario where I need to handle a group of select boxes instead of just one. Each select box holds a different option, and when the user changes their selection, I want to save that value in a variable or an array. I've managed to do this for ...

Tips for removing a checkbox and customizing a label's style when the label wraps around the checkbox input

Hello, I'm an advanced beginner so I appreciate your patience:) I've had success removing checkboxes and styling their labels when the for="" attribute is present. However, I'm facing a challenge with a form where the labels wrap the input ...

Trouble with the alignment of Bootstrap grid columns

I'm facing an issue with bootstrap and I just can't seem to figure out why my columns aren't displaying correctly. I've been trying for the past hour but it's not working as expected. <link href="https://stackpath.bootstrapcd ...

Can Vue Router be configured to show varying layouts depending on the parameter provided?

Is it feasible for Vue Router to exhibit distinct layouts depending on the parameter provided in a URL? Take into account the following URLs: /admin/forms/pending /admin/forms/approved /admin/forms/declined /admin/forms/categories The first three links ...

Having trouble with the border in Tailwind CSS after integrating Flowbite?

Inside this div is where my component is wrapped: <div className="bg-gray-800 border border-gray-700 rounded-lg"> .... </div> When I installed Flowbite, the border color didn't show up as expected. Check out the borde ...

There is a mismatch in the host name: please consider using a domain name (e.g., https://myname.myorg.com) instead of https://localhost

My current setup involves an HTML application that sends an AJAX request to a Qt C++ HTTP Server running on my local computer, hosted at "https://localhost:8081". However, I am facing an issue with a host name mismatch causing the AJAX request to fail. Is ...