Tips for positioning an icon in the middle of an extjs button

Struggling to center the icon on a simple button

{
    xtype: 'button',
    width: 150,
    height: 150,
    cls: 'startbutton'
}

Here is the CSS:

.startbutton { 
    background-image: url(Camera.png) !important;
}

The dimensions of the image are 72x72 pixels.

Answer №1

It seems like utilizing the CSS property background-position would be beneficial:

.startbutton { 
    background-position: center center;
    background-image: url(Camera.png) !important;
}

Answer №2

Can you explain why the typical elements are not being utilized:

logo: '',
logoPosition: 'center'

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

Is there a way to include all images from a local/server directory into an array and then utilize that array variable in a different file?

I'm currently using Netbeans version 8.0.1 with PHP version 5.3 Here is a PHP file example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/199 ...

Error: The typography-config in Angular 4.x is causing an invalid CSS issue in Sass

I'm looking to incorporate my custom fonts into my Angular 4.x project from the assets folder. I am also utilizing Angular Material for which I am defining custom typography in my styles.sass Below is the code snippet: @import '~@angular/materi ...

Utilizing JavaScript to send emails from HTML without relying on the default Outlook client

Is it possible to send an email using JavaScript without relying on Outlook or the mailto object? I'm looking for a direct method that can submit form data directly to an email address. Does anyone know of a way to achieve this with JavaScript? ...

Incorporating a responsive iframe into a jQuery modal dialog box

Attempting to integrate a responsive iframe within a dialog box has been quite the challenge. My initial approach, as seen in Fiddle 1, involved displaying an iframe upon button click, but unfortunately, it lacked responsiveness and failed to resize with t ...

Arranging Cards in Layers on Smaller Screens Using Bootstrap Framework

My row of cards in various sizes looks good on larger screens like this: https://i.sstatic.net/1qF53.png However, on smaller screens, the cards lose their appeal. https://i.sstatic.net/o1NS8.png To improve this, I want to stack the cards so that the ke ...

Once I incorporated Bootstrap into my project, I noticed a noticeable white space between the div elements

Welcome to My Code Playground I was sailing smoothly with my project until I decided to include Bootstrap. Seems like there's something missing in the details, so here I am reaching out. If you spot the issue, please feel free to correct my code. &l ...

Display XML code within an HTML SPAN element

I have a dataset with various string values. In my composite control, I insert these dataset values into HTML table cells using span tags within the RenderContent method. This process works smoothly until I encounter an XML string in the dataset. My Rende ...

anticipating the completion of a task in order to proceed with the next one

I have been attempting to sequence the execution of two functions, but both are running concurrently with my main function. The console is displaying 2, then 1, when it should be 1 first. How can I make sure that the complete function waits for fetchingFun ...

I am experiencing an issue where my Next.js application, developed using Tauri, is not displaying the

My next.js app has a file located at /app/not-found.tsx which functions perfectly when running: cargo tauri dev However, when I compile the app using: cargo tauri build or cargo tauri build --debug And I navigate to a non-existent page, instead of getti ...

What steps can be taken to resolve the Parsing error that is caused by an Unexpected

Having trouble changing the text color and getting a Parsing error? Can someone help me find the error and suggest a solution? Check out my code below import React from 'react'; import react, { Component } from 'react' import { Platef ...

Picture escapes the div in a hurry

I mistakenly placed the yellow dot "gif1" outside of the black box "gif" instead of inside. How many errors can you spot in my code? Take a look at the Livewave Preview to see the current state of the design. I have attempted to fix this issue by using o ...

Sending contact form information

When it comes to sending values from a contact form via email, the process can get tricky when dealing with arrays of multiple values. How do you collect and send these array values using the $_POST method? And more importantly, how do you ensure they are ...

Is there a reason why the ::selection:first-child selector isn't functioning as expected?

What could be the reason for this code not functioning properly? ::selection:first-child{ background-color: #ffa563; } It seems to work well for :first-child:last-child (when element is both first child and last child) ...

Guide to Aligning Logo Beside Title at Equal Height Using Vue.js and Bootstrap

export default { name: 'Sidebar' }; #logo { margin: 20px auto; display: block; width: 50%; border: none; } .nav-item a { color: #83888c; font-size: 18px; } .nav-item { justify-content: space-around; } .data-uri-logo1 { backgr ...

Show an HTML image with the file chosen through the FileDialog prompt

After spending about four hours searching for a method to display the image file chosen by FileDialog in a browser within an img tag, I came across various pages suggesting updating the src attribute of the img tag with the content of the file. However, th ...

Update the href property in the provided JSFiddle code to enable the integration of YouTube videos with Fancybox

After upgrading from Fancybox 1.3.4 to Fancybox 2.1.4, I've encountered issues with the href property not working correctly with my YouTube videos. If you could take a moment to review this functioning jsfiddle that I'm attempting to edit. Esse ...

Employing a PHP script to periodically replace index.html multiple times throughout the day

Imagine I have a vision of creating a basic webpage where I update a sentence daily about my emotions, replacing the old one every time. An option could be to retrieve the sentence from a database for each visitor, resulting in this page load sequence: ht ...

Issue with the URL associated with the CSS file

As a PHP beginner, I'm having trouble linking to the CSS file using the provided codes. Can anyone help me troubleshoot what's wrong with my code? The issue seems to be in the following snippet from header.php: <html lang="en"> <head&g ...

Tips for eliminating the default arrow on the HTML select tag?

I am currently utilizing vuejs along with tailwindcss and I am trying to figure out how to get rid of the default arrow from an HTML select element. Despite my attempts to remove it by using CSS properties like -moz-appearance, -webkit-appearance, -ms-appe ...

Is SqliteDataReader not compatible with C#?

Currently, I am facing an issue with displaying data from a SQLite database on a web page using C#. Despite my efforts to find a solution and only coming across the console.writeline method, the SqliteDataReader function is not functioning properly. Below ...