Achieve uniform display across browsers: Implement Chrome's overflow ellipsis feature on Firefox

I am seeking a CSS solution to achieve the same "overflow: hidden" and "text-overflow: ellipsis" behavior in Firefox as I get in Chrome. In Chrome, when the width of the tag is reduced, the text gets hidden and replaced with an ellipsis. However, in Firefox, the text becomes hidden up until the first letter of the word, as illustrated in the images below.

Chrome Example:

Firefox Example:

The following code snippet showcases the issue across different browsers:

.resizable {
  resize: both;
  overflow: auto;
  display: flex;
  height: 40px;
  width: 400px;
}

.wrapper {
  border-left: 4px solid #dcdedf;
  margin: 0 8px 5px 0;
  display: flex;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 29px;
  max-height: 15px;
}

.chip {
  border: 1px solid #dcdedf;
  border-left: none;
  font-family: Roboto, sans-serif;
  position: relative;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 0 4px 4px 0;
  white-space: nowrap;
  overflow: hidden;
  max-height: 15px;
  text-overflow: ellipsis;
  padding: 0 8px;
  font-size: 10px;
  word-break: break-all
}

Answer №1

To ensure compatibility with Firefox, it is important to include white-space: nowrap;

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

Having trouble getting AngularJS ngCloak to function properly?

My post category page is supposed to display a message if there are no posts. However, the HTML appears briefly when the page loads and then hides. I thought using ngCloak would solve this issue, but it doesn't seem to be working for me. Here's t ...

The trio of Chrome, Windows Authentication, and XHR working together synergistically

Our team is currently working on an application using AngularJS for the frontend and C# .NET for the backend rest services. As part of our Windows Authentication process, we rely on actionContext.RequestContext.Principal.Identity to retrieve user informati ...

What is the process for extracting Html sub elements from parent elements?

While using my HTML editor, specifically the Kendo Editor, to generate bullets and indent them for sub-bullets, I noticed that the HTML output wasn't as expected. <ul> <li>Focusing on lifetime income replacement <ul>< ...

jQuery issue: Inability of "Read More" span to reappear after clicking "Read Less"

Currently in the process of creating a portfolio website that showcases project descriptions with an excerpt, revealing full details upon clicking "Read More." My experience with jQuery is limited, but I managed to implement functionality where clicking "R ...

Is it feasible to use a component in a recursively manner?

Following a two-hour search for a solution, I decided to reach out to experts as I suspected the answer might be simpler than expected. The project in question is an Angular7 one. In my goals component, I aim to include a "goal" with a button labeled "+". ...

Experiencing Difficulty Retaining Checkbox State Using LocalStorage Upon Page Reload

At the moment, I have a script that automatically clicks on a random checkbox whenever the page loads or refreshes. Through localStorage, I can also view the value of the input assigned to the randomly selected checkbox. However, I'm facing an issue ...

Using VBA with Selenium and Chromedriver to download and store PDF files

Here is a link to a PDF file that opens in Chrome: PDF file. Is there a way to save this PDF file directly from this page? I am running chrome with the following settings: driver.SetPreference "download.default_directory", "c:\chr" ...

Turn off all the styles associated with a specific CSS selector

Looking for a solution to override CSS rules for the .lp-caption selector? .lp-caption { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; backgr ...

The HTML5 audio player is experiencing technical difficulties on Internet Explorer

I'm having an issue with html5 audio not working on Internet Explorer. <audio id="beep-voice" controls autoplay style="opacity:0"></audio> Could someone please provide a solution? Thanks! ...

Is the height of the element determined by the parent rather than the content?

I need help with a layout featuring three containers - Total (with a red border), Left (yellow border containing an image), and Right (blue border containing text). Left is set to approximately 30% width with float: left, while Right is set to 70% width w ...

Exclusive Pages in NextJS for Development Purposes

I want to set up a /storybook page specifically for development purposes. However, I do not want this page to be accessible in production mode. How can we make that happen? ...

Sending information to the styles feature in Angular 2

Is there a way to transfer data from an Angular tag to the styles in the @Component? Take a look at my component: import { Component, Input } from '@angular/core'; @Component({ selector: 'icon', template: `<svg class="icon"> ...

Utilize multiple background images in CSS with a set of three unique images

I have inserted three images into the background of my website's body. Two of them are displaying correctly (one with repeat-y), but the third one is not working. I've tried searching a lot but couldn't find a solution. body { backgr ...

How to align text to the bottom of a div using CSS

I am struggling to position the text 'About' at the bottom of an image. The red line marks the spot where I want the text aligned at the bottom. However, every method I try results in inconsistent outcomes when viewed on desktop and mobile device ...

What is the best way to eliminate the left margin entirely in CSS?

I am attempting to create an image view that fully covers the window, without any margins. I have tried various solutions such as setting the body margin and padding to 0, but they do not seem to work. body { margin: 0px; padding: 0px; } or *, html { ...

Creating a JQuery slider that efficiently loads and displays groups of elements consecutively

Currently, I am in the process of developing an infinite horizontal tab slider using jQuery. My main objective is to optimize loading time by having the slider display only the first 10 slides upon initial page load. Subsequent slides will be loaded as the ...

Applying Compiled CSS file in Node.js using Express and SASS not working as expected

Recently, I've delved into utilizing NodeJS with Express to serve my pug files. In addition, I decided to incorporate the "express-sass-middleware" to compile and serve the scss/css files in my project. While everything seems to be functioning as expe ...

What could be causing my website to extend beyond 100% width?

I've been working tirelessly on solving this issue for the past week, but unfortunately, I haven't had any luck finding a solution. The problem arose as I was designing a launch page for a program that my friend is developing. Despite setting the ...

The comparison between AJAX and JSON passing and PHP generating HTML versus returning it

Currently, my code looks like this: <li onclick = " function CBAppData( callerObj, data ) { var string = ''; for( a in data ) { debug.push( data[ ...

Problems with Socket.IO compatibility on both Chrome and Firefox

Exciting News Update: The issue has been identified even when the application is running on localhost. After conducting a thorough investigation, it was discovered that the proxy server is causing the problem. Here is the code for the proxy server: var s ...