Low resolution icons in Cordova using JQuery Mobile

Currently, I am working on a Cordova application and encountering an issue where the icons appear low resolution when running it on Android or a browser. I came across a solution online advising to add the following code snippet to the meta tag:

<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, target-densitydpi=device-dpi, user-scalable=0, target-densitydpi=medium-dpi" />

However, this did not solve the problem for me...

You can view the problem in action through this fiddle: LINK

This is how I am implementing the icons in my code:

<i class="ui-icon-departure ui-btn-icon-notext inlineIcon"></i>

And this is the corresponding CSS:

.ui-icon-departure:after {
    background-image: url("../img/icons/departure-icon.png");
    background-color: transparent;
    background-size: 18px 18px;
}

https://i.sstatic.net/wtqtP.jpg

Answer №1

This is unrelated to meta tags. Your approach involves using CSS to alter the size of a 427x325 PNG image to 18x18 - not only reducing it significantly in size, but also distorting its proportions in the process.

Consider creating a PNG with double the intended display resolution for a sharp and crisp retina appearance (for instance, if the final display will be 18x18, save the image as 36x36).

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

Adding pictures to Cloudinary

My goal is to upload files directly to Cloudinary using nodejs. I have managed to achieve success when I manually set the path of the image I am uploading, as shown below: cloudinary.uploader.upload('./public/css/img/' + data.image) However, whe ...

Erase all records using MongoDB by the following criteria or

I am currently working with a calendar document structured as shown below: calendar: [ {days: { 1: [], 2: ['surprise'], 3: [], ... }}, {days: { 1: [], 2: [], 3: ['test'], ... }} ] My task involves locating specific ...

Incorporate text onto an image using Semantic UI

Currently, I am utilizing Semantic UI to display images. While it is functioning well for me in terms of adding text near the image, I desire to have the text positioned on top of the image. Ideally, I would like it to be located on the lower half of the i ...

Embed the div within images of varying widths

I need help positioning a div in the bottom right corner of all images, regardless of their width. The issue I am facing is that when an image takes up 100% width, the div ends up in the center. How can I ensure the div stays in the lower right corner eve ...

Having trouble with applying CSS conditionally in React JS with Typescript?

I'm currently facing an issue with my code where I want the Box to stay highlighted with a black border when clicked. Here's the snippet: interface BigButtonProps { onClick(): void; Title: string; Description?: string; startIcon?: R ...

A step-by-step guide on incorporating a dynamic data series into a line chart using the powerful tool

The data retrieved from a webservice is processed using the BindTrend method and then converted to a JSON object before being applied to the chart. The code for this process is as follows: var plot; var itemdata = []; var chart; var data = [] ...

Neglecting to incorporate pagination within the Firebase Realtime Database

Implementing pagination for data retrieved from the firebase realtime database involves fetching a specific set of content based on page number. The goal is to obtain the first n items according to the page number and then retrieve the last n items from th ...

The issue with the page width is occurring due to a bug related to the

When pages contain the AddThis code, they tend to become very wide due to the code itself, resulting in a horizontal scroll bar appearing. However, by removing the code or changing the page direction to LTR, the issue is resolved and the page width return ...

Is there a way to adjust the speed of the transitions between animations?

I've been experimenting with ways to increase the time between animations in my cycle. Adjusting the duration of the keyframes animation hasn't yielded the desired effect. span { animation: rotateWordsFirst 15s linear infinite 0s; ...

transferring a string parameter from PHP to a JavaScript function

I have been searching for a way to transfer a string (stored as a variable $x) from PHP to JavaScript. I came across several code solutions, but I am wondering if these strings need to be declared as global variables? Even after declaring it as a global va ...

JQuery: Select the parent element but exclude one of its children when clicked

Check out my fiddle here. I'm trying to trigger some actions when the parent box is clicked, except for one child with the class of .notClickableCol. I attempted using :not(), but it isn't currently functioning as expected. This code works when ...

Duplicating nested mapping in a React element

Struggling with mapping data in order to display it correctly. I have removed a large portion of the data, but the general structure remains intact: { "userData":[ { "name":"something", "job&quo ...

What is the best way to print a canvas element once it has been modified?

My goal is to include a "Print Content" button on a webpage that will print a canvas element displaying workout metrics. However, the canvas content, which consists of a visual graph of workout data, changes based on the selected workout (bench, squat, etc ...

Laravel 5.0 facing issues with AJAX requests

For my Laravel 5.0 project, I am utilizing Google API's for Google Oauth login. After successfully retrieving the email and id_token of the currently logged-in user, I aim to send this data to the SigninController to access our own API. The goal is to ...

Running NodeJS scripts with ElectronJS is not possible

Goal I'm facing a challenge with executing my separate scripts located in the project/api folder. Let's take test.js as an example, where I am exporting it using module.exports. When I run my electron window and create a JavaScript file with a f ...

When the datatable is loaded with over 50,000 records, the browser experiences lag and becomes unresponsive

In my application, I have implemented datatables along with a handler to bind data. I am using JSON data format for data manipulation. The issue arises when I attempt to retrieve data for the second time. Initially, all 100,000 records load successfully o ...

Error when using a third-party library in a jQuery plugin on an Android device

Currently, I am working on an application that utilizes a jQuery UI plugin, which then relies on the Raphael library. Everything runs smoothly on iOS and standard browsers, but when it comes to Android, I encounter the following error: ReferenceError: can ...

An easy guide to rerouting a 404 path back to the Home page using Vue Router in Vue.js 3

Hello amazing community! I'm facing a small challenge with Vue.js 3. I am having trouble setting up a redirect for any unknown route to "/" in the router. const routes = [ { path: "/", name: "Home", component: Home, }, { path: "* ...

Reloading a page will display [object CSSStyleDeclaration]

Upon editing content and saving changes, instead of displaying my updated content when refreshing the page, it shows [object CSSStyleDeclaration]. function newElement() { let li = document.createElement("li"); let inputvalue = document.querySelector ...

Implementing nested popup windows using Bootstrap

I am facing an issue with my two-page sign-in and sign-up setup in the header of my angular2 project. On the sign-up page, I have a link that should redirect to the sign-in page when clicked, but I am struggling to make it work. Can someone provide guidanc ...