Text-overflow: Ellipsis mysteriously disappears behind text when viewed on Android devices

Attempting to use ellipsis with a h2 tag using text-overflow. Everything seems to be working correctly in all browsers except for Android.

The three dots seem to appear behind the clipped text, making the ellipsis invisible.

The CSS for the h2 element is as follows:

h2 {
    font-size: 20px;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 40%;     
}

I have tried many different styles but haven't found what might be causing this issue.

A test with dummy content worked fine, so I am curious if anyone else has encountered this problem before?

Answer №1

After carefully analyzing the CSS code, I was able to identify the issue. It seems that the culprit causing the bug was the line

text-rendering: optimizeLegibility;
. I removed this line and now everything is functioning flawlessly!

Answer №2

Success! I tried this solution and it worked flawlessly.

The key is to include text-rendering: auto; in the css style with ellipsis applied.

Visit this link for more details.

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

SassError: Variable not defined

I have a file containing variables with different themes that I need to override: _vars.scss body { $bg-color: #fff } body.theme-dark { $bg-color: #333 } In my Angular button component, I am referencing these variables: button.scss @import '_va ...

Elements appearing outside their designated container

I'm struggling with my boxes and their content. Each box has different amounts of content, and I can't seem to get them to resize automatically to fit the content. The overflow:hidden; property hasn't helped either. Any suggestions? Thank y ...

The height setting for the table does not appear to be effective

Here is the structure of my HTML: <div class="wrapper"> <table> <tbody> <tr> <td>some content</td> </tr> </tbody> </table> </div> The style for my wrapper looks like this: .wrapper{ color: #444 ...

Is there a reason why I can't seem to display the rc-slider and its label side-by-side on the same row?

When trying to add a label to the rc-slider in the same row using bootstrap grid, I noticed that the label and slider are appearing on two separate rows. <div className="row"> <div className="col"> Label: </div> ...

In need of assistance with adding a divider within a box using HTML/CSS

As a beginner, I may have messy code but I'm working on creating a job search page with a bar displaying the results like this: I've almost got it, except I can't figure out how to add that divider between PREV, 1 to 100, and NEXT. My curre ...

Using node.js to modify the appearance of the form submission button's color

When using node.js to insert data from an HTML form into a database, validation typically occurs on the server side. I am wondering if there is a way to customize the CSS class associated with the submit data button in node.js. For example, I would like ...

Should font size, line height, and font-family be declared to the body before or after the CSS reset?

Let's say I am using the Eric Meyer Reset and I need to apply a style to the body element. body { font: 100%/1.5 "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif;*/ } Should I place this before or after the reset CSS? html, body, div, span, a ...

Any tips on creating a website with a gradient background that moves along with the window as you scroll?

Can anyone help me figure out how to achieve this? I'm trying to create a similar effect to the one on the fireship website, but I'm having trouble replicating it. Appreciate any guidance. Thanks! ...

Strategies for restricting user input within a datalist

I have a project in which I am creating a webpage that displays a list of flights that can be filtered by destination, origin, price, and more. To achieve this, I have categorized each flight within a div element using its specific properties as classes. F ...

Fixed width select2 input group

Why does the input group select 2 element disrespect the parent element width by extending beyond what is necessary? Selecting a normal option appears to be fine. However, when I choose a longer option, it ends up looking like this. Is there a way to se ...

CSS: Only one out of three <div>'s has the styles applied in JSFiddle

When working on my project, I encountered an issue while trying to add CSS styles to three <div> structures with unique IDs. Strangely, making small changes to unrelated CSS caused elements to go from being stylized to losing their style. If you com ...

Implementing Jquery UI auto complete feature within a navigation bar

Having an issue with an autocomplete input in the header. The UI-widget-content is not appearing just below the input field, it seems to be hidden by the navbar. <div class="form-inline header-form"> <div class="ui-widget"> ...

Creating a Website Optimized for Mobile Devices

As a beginner web developer, I am in the process of creating a mobile-friendly website system. Currently, I am utilizing Bootstrap for responsiveness, PHP5, MySQL, and occasionally Ajax/JQuery. Recently, I came across JQuery Mobile. While I have been usin ...

Is there a way to prevent jQuery.ajax() from displaying errors in the console?

I have set up a jQuery JSONP request to monitor the status of a resource based on its URL. In case the resource is not accessible or the server goes down, my ajaxFail() function takes care of updating the display. function fetchServerStatus(service, host) ...

How to include padding in HTML elements

Looking for help with aligning this html code equally. <address class="address"> <span>Support E-mail:&nbsp;</span><a href="#"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-c ...

Creating a menu that is even more optimized for mobile devices

I recently came across a mobile menu style that I really like: https://www.w3schools.com/html/default.asp What I appreciate about this style is that even on smaller screens, it still displays some main navigation items. This allows for popular links to be ...

Workaround for Google Chrome Session Cookie Functionality

After discovering that Chrome's "Continue where I left Off" feature allows cookies and sessionStorage to persist between browser restarts, it became clear that many users were facing the same issue. Despite numerous threads on sites like Stackoverflow ...

How come the html element doesn't have a default height of 100%?

Is there a reason why the html element is not automatically set at 100% height by default? Can you think of any scenarios where having it take up less than the full height of the window would be beneficial? html { height: 100%; } [Update] I modified th ...

Utilize Boostrap to stylishly incorporate an image within a DIV using CSS

I have a project with numerous HTML pages all containing the same elements. To make updating easier, I decided to call all images from the CSS files so that if an image needs to be changed, I only need to update the CSS file rather than each individual HTM ...

Achieving Full Height and Width of Tab Panel with Bootstrap 4.3

I recently upgraded to bootstrap 4.3 and discovered the handy sizing classes m-* and w-* for setting element height and width. After successfully achieving 100% height and width for the container, I'm now looking to apply these dimensions to the tab-p ...