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?
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:
- adding display: block; width , height set, can override inherited display settings.
- reduce amount of css troubleshoot, you've missing small part, has moved or hidden actual container
- if else fails, step step on jsfiddle , when continues work required, try copying over. helps learn
Comments
Post a Comment