Switch up the Quasar Element's Appearance

I'm currently using the Quasar framework in my application (click here to check it out). Within the "Timeline" function, I have integrated a q-select element for selecting a country. While I successfully fixed the width of the q-select element itself, I am facing challenges in fixing the width of the list displayed below it (the width changes based on the length of the country name, which is not very user-friendly).

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

Can someone guide me on how to fix the width of the list right under the q-select element?

Here's a snippet of my code:

<q-select outlined v-model="country" :options="data" option-label="name" label="Select a Country" class="input" />

<style scoped lang="scss">
  .bg-color {
    background-color: #e7e8d1;
  }
  
  .input {
    width: 200px;
    margin: 10px 0;
  }
</style>

Answer №1

When creating a dropdown list in HTML, the generated code for the dropdown itself is separate from the input element used to select it. To set a specific width for the dropdown menu, you can target the q-menu class and specify a width of 200px.

.q-menu { 
  width: 200px;
}

If you want only certain dropdown menus to be 200px wide, you can create and apply a new class within your code for those specific instances.

Here is the resulting output:

https://i.sstatic.net/0Q7cJ.png

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

Utilize a prefix when importing Vue from the node_modules directory

Setting up my development environment on Ubuntu 20.04 involves using the following tools: PhpStorm 2020.3 as my IDE CodeIgniter v4 Vue 3.x Tailwind CSS+UI After creating a test project, I followed the documentation and ran the following commands: npm ins ...

Styling the cursor in an input box: Using CSS and Javascript

After spending some time delving into the code of wallbase.cc, I've been trying to uncover the secret behind styling the input box similar to the one featured on their homepage. My main curiosity lies in how they achieve the quickly blinking cursor an ...

The spacing problem arises from the interaction between two HTML tags containing a Bootstrap file

view image details hereUsing Bootstrap 5, I have a screenshot with an h5 element in a black border and an em tag in a red border. I specified margin 0 to the h5 element but it still does not touch the em tag (in red border). I have tried adjusting line spa ...

Make sure to have the list available while choosing an item

I want to design a unique CSS element with the following characteristics: Include a button. When the button is clicked, a list of items (like a dropdown list) should appear. We should be able to select items by clicking on them, and the parent component s ...

Loading Website Content, Track your Progress

I'm facing an issue with the website loading progress bar. The script I'm using for the progress bar is not functioning correctly on the Web server www.example.com. Even though the website is live on the web server, the problem is that the progre ...

Switching Flexbox CSS from a column layout to a row orientation

When the viewport width reaches 750px, I want to use flexbox to change the layout of my information from one column to four rows: * { box-sizing: border-box; } h1, h2, h3, h4, h5, h6 { text-align: center; } section { border: inset #333 thin; p ...

Animate a CSS transition to smoothly slide a hidden div into view from the edge to the center of the

I am looking to create an animated floating div. When the div is in the 'closed' state, most of it is hidden on the right side of the screen, with only 20px still visible. Upon clicking the visible part, I want the div to move to the center of t ...

Generating Dynamic Image Sources with Vue 3 using Rollup

Dealing with dynamic image src using Rollup in a Vite-app: <img :src="??" alt=""> Any suggestions on how to achieve this without Webpack's require? ...

How can I force a Kendo UI Chart to resize in VueJS?

When integrating Kendo UI's Chart component within a Vue application, how can we trigger the chart to refresh or redraw? Although the chart automatically adjusts to changes in width by filling its parent container horizontally, noticeable stretching ...

Adjusting CSS using JQuery based on scroll position

I am attempting to dynamically change a CSS style depending on the viewer's position on the page. Despite researching numerous similar threads online, I have not been able to get this code to work as intended. Any assistance would be greatly appreciat ...

Adjust the image size to fit the page according to its height

Having a dilemma here. I have this square image (2048x2048) that I want to set as a background. The tricky part is, I want it to display borders when the page stretches into widescreen mode, but also resize while maintaining its square shape when the page ...

Child element within a nested CSS grid expands or shifts beyond its container

Explore my CodePen project here Greetings, I am currently working on creating a grid layout showcasing 6 links to various projects. Each link is comprised of an image template along with a detailed text description below it. The parent container for each ...

The VueFire object is not defined

Here's my code snippet: const firebase = { items: { source: db.ref('items'), asObject: true, readyCallback: function() { console.log('items retrieved!'); } } } new Vue({ el: '#app', firebas ...

What is the best way to combine two sections in html/css/bootstrap?

I've been trying to create a simple webpage with a navigation bar and a section below it, but I keep running into an issue where there's unwanted white space between the nav bar and the next section in blue. Is there a way to eliminate this gap a ...

Removing the Yellow Highlight on Input Field Following Email Autocomplete in Chrome

My username-password form is styled and working perfectly, but there's an issue that arises when I log in multiple times. Chrome automatically fills in my email, turning the username textbox yellow. It doesn't seem to happen with Firefox or Safar ...

How come the last word in CSS nested flexbox wraps even though there is space available?

I am facing an issue with a nested flex container setup. Below is the code snippet: <div class="parent-container"> <div class="child-container"> <span class="color-block"></span> <span>T ...

Is there a way to dynamically alter a Vue component based on time? When I say alter, I am referring to one component replacing another, similar to how a carousel functions

Is there a way to make the widgets on my Vue website cycle every few seconds, like in a carousel? I want them to replace each other periodically. What is the most effective method for accomplishing this? ...

Experiencing difficulty aligning the Material UI grid to float on the right side

I'm currently in the learning phase of material-ui and encountering an issue with floating the grid content to the right side. Despite trying alignItems="flex-start" justify="flex-end" direction="row" in the container grid, as well as using the css p ...

Using jQuery, adjust the width of child elements within a container by applying dynamic CSS styling

I am attempting to dynamically set the width of several child elements using jQuery. Here is what I am trying to achieve: Obtain the count of the desired containers (since there will be multiple instances of the .steps-container class in the DOM) Iterate ...

"Efficiently Triggering Multiple Events with One Click in JavaScript

Hey everyone, I could use some assistance. I'm trying to execute multiple events with a single click. Currently, I can change the image in my gallery on click, but I also want to add text labels corresponding to each image. Whenever I click on a diffe ...