Short select fields contain abbreviated text

Is there a solution for dealing with truncated text on short select fields?

I have a narrow select box with padding, and in Chrome the text gets cut off if it's too long. Removing the right padding fixes this issue, but then the menu button looks squished against the edge of the field in IE.

Does anyone know of a solution that doesn't involve hacks or using a different control? It's just a basic select box with some padding applied.

Edit: jsfiddle link: http://jsfiddle.net/jgA8K/2/

Example Html:

<select>
    <option>AM</option>
</select>

Example Css:

/** Imagine a CSS RESET here **/
select
{
    background: #fff;
    border: 1px solid #444;
    margin: 10px;
    padding: 13px;
    width: 70px;
}

Answer №1

The issue here is that the select box has been restricted to a fixed width of 70px, causing the padding to adjust accordingly. To maintain both the padding at 13px and the 70px width, the CSS has compressed the select arrow into a smaller space. One solution could be to either reduce the padding to 10px or increase the size of the box itself.

Another option would be to slightly adjust the font-size to better accommodate the text. For example, you could add font-size:12px; in your select style to ensure the text remains visible and visually appealing. Hopefully, these suggestions help resolve the issue!

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

The positioning of elements varies between mobile devices and desktop screens

Recently, I've been playing around with jQuery and created a popup menu of sorts. The positioning of the popup div is calculated when it's shown or when the window is resized. I've noticed that the positioning doesn't work correctly on ...

I am encountering difficulties in accessing my component's property within the corresponding template while working with Angular 5

When I call an HTTP POST method to retrieve table names from the backend, I attempt to display them in the template using ngFor. However, the table names are not appearing on the screen. The tNames property is inaccessible in the template. As a beginner i ...

Steps to configure JavaScript to initially conceal a div within a continuous loop

I have implemented a JavaScript function to toggle the show/hide functionality of a div class. The content of the div and the button that triggers the toggle action are both inside a while loop. Initially, I used "div id" in my JavaScript code, but it was ...

Tips for deleting an element from an array within the scope of AngularJS

A basic to-do list application with a delete button for each item on the list page: https://i.sstatic.net/s0Oxd.jpg Here is the HTML template code snippet: <tr ng-repeat="task in tasks"> <td>{{task.name}} - # {{task.id}}</td> <t ...

Troubles with showcasing icons on a website

I need some help with a minor issue that I'm stuck on. I'm trying to display an information icon that, when clicked, opens a pdf. The strange thing is that the icon doesn't show up on the page even though it exists on the server. However, wh ...

Can CSS be used to eliminate shadows from a particular image?

Is it possible to eliminate the shadow from a specific image that is displayed multiple times on various pages of a website? This particular image should not have any shadow. Link to Image The image can be found on pages like this one: Page Link Below ...

Please provide the text input for the specified version numbers (1.1, 1.2, 3.0, etc.)

I'm currently working on a form that includes a section for searching by version number: <label class="formLabel">Version</label> <html:text property="valueVersion" styleClass="value" tabindex="11"/> <br/& ...

Tips for incorporating the <li> element into a versatile layout

My dilemma involves a div containing multiple ul and li elements that are struggling to fill the available space effectively. The issue arises when there is either excess space on the right side or one of the uls gets displaced below the others due to vary ...

Content in Bootstrap not filling entire mobile screen

The content in this form does not stretch to full screen on mobile phones, but it appears properly on computers and tablets. Please advise on how to solve this issue. https://i.stack.imgur.com/S2XkS.jpg <link rel="stylesheet" href="https://maxcdn.bo ...

Conceal the server's internal file structure to prevent it from being displayed in sources

When I visit my website and inspect the elements in Google Chrome, I am able to see a list of all the folders on my site under the sources tab. This reveals their original names and allows for the downloading of the entire website code. I am concerned abo ...

The functionality of Materialize CSS tabs appears to be malfunctioning

I've been working on a mobile profile UI and using materialize css, but unfortunately the tabs aren't functioning properly. Here's the code snippet: http://codepen.io/anon/pen/VmmJWv html: <meta name="viewport" content="width=device-w ...

Add HTML within a targeted <li> element using ng-repeat in AngularJS

I recently embarked on my AngularJS learning journey through Pluralsight. Following the tutorial, I was able to create a Github user listing application using routing and basic directives. <div ng-controller="RepositoryController"> <h3 ng-hide="! ...

I'm feeling a bit lost on how to pull out HTML tag elements using Python

I have been attempting to extract the html tags for alternative purposes, but due to the structure of the html file, I am facing challenges using conventional methods to locate the elements. The section containing the elements is quite long (consisting of ...

Div with absolute positioning not aligned correctly on Mac/iOS but displays correctly on Windows

Struggling with this issue for a few days now and I can't seem to pinpoint the cause. After some online research, it seems like a collapsing margin bug might be the culprit, but I'm hoping to get a clear answer or at least some guidance. I have ...

What could be causing the show button to change its style every time I click it?

I'm a beginner in the world of JavaScript. I have been working on customizing the "show more" button and encountered an issue. I managed to add text and a down arrow below the button, but when I click it, another button labeled "I don't know how ...

Having trouble implementing an onClick event to change a button's CSS to href in Vue.js

When working with a SinglePageApp and using UIKit (UKit), I have found that I need to use a <button> tag instead of an <a> tag. Previously, the <a> tag was written like this: <a type="button" class="uk-button uk-button-link" href="#e ...

What steps should we take to address our client's aversion to pop-up advertisements?

Are there any alternatives or improvements to using JavaScript pop-up windows other than simply showing and hiding a <div>? Appreciate any suggestions! ...

Explain the concept of paragraph spacing in Word, including how it is

When working with my ms word 2010 document, I often use the includetext-function to incorporate HTML content: { INCLUDETEXT "test.html" } Here is an example of the HTML code that I am trying to include: <html> <head> <meta http-equiv="Co ...

Guide to creating a Bootstrap Select Dropdown that functions as a Tab List by utilizing option elements with role=tab

Can the functionality of a Bootstrap Select Dropdown menu be changed to act like a Tab List? Specifically, I would like the content in the Select to change based on the user's selection from the <option> value. While there is a bootstrap-select ...

I'm curious about the specific purpose of /1 in font styling at 16px

Can anyone explain the purpose of /1 in the font: 16px/1 style declaration? I removed the /1 from the code and noticed increased spacing between lines. What is the specific role of /1 in this situation? body { font: 16px/1 'Open Sans', sans ...