html - Not able to set background image with Ionic -


so started out ionic framework. , trying add background image. when run application in browser, don't see image. in console 404 error. believe path correct. followed tutorial after not sure if css correct. same have got. know problem exactly?

enter image description here

part of html code following:

 <div class="logo"></div> 

and css following:

.logo{     background-image: url('../img/logo.jpg');     background-repeat: no-repeat;     background-size: contain;     background-position: center;     width: 80%;     height: 246px;     margin: auto;     z-index: 2;     position: relative; } 

some problems can occur using 'background' in css, when container doesn't have other contents.

try following:

  1. adding display: block; width , height set, can override inherited display settings.
  2. reduce amount of css troubleshoot, you've missing small part, has moved or hidden actual container
  3. if else fails, step step on jsfiddle , when continues work required, try copying over. helps learn

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -