Size of the image inside the ion-header


I’m putting a background-image on my ion-header, but the image seems to be zooming

enter image description here

In the first image it is as it is and in the second as I would like it to be

.background-header {
    background: url(../img/bg_header_menu.png) !important;
    background-size: cover;

I tried background-size: cover, 100% and a few more things but did not succeed


EDIT with html:

<ion-header-bar class"background-header">

Sorry for the poor explanation, what happens is that the first image seems to be zooming. This way the strokes do not look the same in the second image.

And the image size is 1366×177, it’s not a repeat image


well. using

background: url(../img/bg_header_menu.png) !important; will make all the default background-properties to be important ( image, position, repeat, attachment etc ) so the next thing you wrote , background-size:cover, is null because of that previous important

you should use background-image:url(../img/bg_header_menu.png) instead of background

see snippet example below :

.background-header {
    background-image: url( ;
    background-size: cover;
    background-position:center center;


<ion-header-bar class"background-header">


OR you can use

 background:{url( no-repeat scroll center center /cover transparent  }

if you want to use all the background properties in one style

Answered By – Mihai T

Leave a Comment