SVG image as a background image in a phone 8 telephone and telephone spread

I use the SVG image as the background in the phonegap project for windows phone8, but it does not show. Below is the code

.loyaltystar { 
    position:absolute; margin-top:3px;
    background:url(../img/available-icon.svg) no-repeat;
    width:21px; 
    height:21px; 
}

<li><a href="a.html" class="loyaltystar"></a></li>

- Phonegap 2.4 supports SVG for a Windows 8 phone.

+4
source share
2 answers

Having received the solution, I removed the initial xml tag from the image and now its work ...

+6
source

Include a background-size style, for example:

.loyaltystar {
  display: block;
  text-indent: -9999px;
  height: 21px;
  width: 21px;
  background: url(../img/available-icon.svg) no-repeat;
  background-size: 21px 21px;
}

Otherwise, it may be a problem with the path .. / img / available -icon.svg. Make sure the URL for your image refers to the URL of your CSS stylesheet (and not your HTML page).

+1

Source: https://habr.com/ru/post/1537665/


All Articles