웹 사이트를 개발 중이며 망막 디스플레이에 도움이되는 svg 파일을 구현하고 싶지만 폴백 파일을 백업으로 사용하고 싶습니다. 이것은 html/js/css입니다.jQuery 및 svg 파일
<div id="band">
</div> <!--band-->
<script>
$(document).ready(function() {
if (Modernizr.inlinesvg) {
//SVG.
$('#band').html('<img src="barbGradient.svg" />');
} else {
//No SVG.
$('#band').html('<img src="barbGradient.png" />');
}
});
</script>
이것은 CSS입니다.
}
.no-inlinesvg div#band {
position: relative;
top: -950px;
background-repeat: repeat-x;
background-image: url('../_images/barbGradient.png');
z-index: -1;
}
.inlinesvg div#band {
position: relative;
top: -950px;
background-repeat: repeat-x;
background-image: url('../_images/barbGradient.svg');
z-index: -1;
}
모든 브라우저가 끔찍하게 렌더링 중입니다! 다른 해상도에서 두 개의 PNG를 포함 할 수 있지만 js 메서드가 더 똑똑하다는 것을 알았습니다! 어떤 도움을 주시면 감사하겠습니다!
왜 당신은 이미지로 DIV의 배경을 가지고 않으며, DIV는 응답을,뿐만 아니라 –