我正在使用slick.js创建幻灯片.一切都很好,除了点.他们出现了,但他们出现了这个奇怪的字符串(http://newsinteractive.post-gazette.com/40for10/img/slideshow/weird_chars.png).
我的代码似乎没错.怎么了?
jQuery的:
$('#slideshow2').slick({
arrows: true,
prevArrow: "<i class='fa fa-2x fa-arrow-circle-o-left'></i>",
nextArrow: "<i class='fa fa-2x fa-arrow-circle-o-right'></i>",
accessibility: true,
adaptiveHeight: true,
dots: true
});
Run Code Online (Sandbox Code Playgroud)
CSS:
.slick-dots
{
position: absolute;
bottom: 0px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
background-color: white;
}
Run Code Online (Sandbox Code Playgroud)
这是Mindaugas建议的编码问题.
马修斯的解决方案是误导性的,你就不会需要下载CSS文件虽然这工作,因为在实际的.css文件编码的规定.
例如,我没有下载css,只是通过向charset="UTF-8"我的<link>标签添加属性就成功从CDN中提取.
完整的解决方案如下:
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" charset="UTF-8" />
Run Code Online (Sandbox Code Playgroud)