我很难弄清楚为什么我的SVG图像模糊?我尝试根据屏幕大小(小,中,大)使用不同大小的图像。由于我无法正常工作,因此我读到SVG是您最好的选择,因为它会自己最大化,最小化。但是,我的客户仍然觉得图像模糊。它们在台式机和移动设备上模糊。我似乎不知道为什么。是否可能因为它们在<div>
内?我正在为整个项目使用引导程序。我通过<img src>
导入它们,我查看了SVG图像,并确保将它们四舍五入为最接近的整数。例如,徽标svg都是整数,并且大小都相同。如果有人可以告诉我,我将不胜感激。
徽标图片尺寸
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="212px" height="69px" viewBox="0 0 212 69" preserveAspectRatio="xMidYMid meet" ><rect id="svgEditorBackground" x="0" y="0" width="212" height="69" style="fill:none;stroke:none;"/><image x="0" y="0" width="212" height="69" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAABFCAYAAAAy5Mj+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4goUFAgSItw4rAAAGLlJREFUeNrtnXmUHMV9xz+/6u6Z2XtXu7pvVgc6QCskYa4gwMjmNDaHz/jChCOxiI8kJs8vcZy82HHi4NiQEOI4BBtMnIDAxmBskAyK7YAAW7IFEodkIYQkJO0l7e7szkx35Y+q3umZnVmtdiUG4f68N2+nr+qqmvrW71e/qu6FmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJg3NVLpDIyFz57/OI4IrhIcERxlPn/xwzMrnbWY31GOG0F95Iyf4CmVF5Ayf10FjghJVw2KylWCGznPEeGG/zm10kWI+R3gTS+o9536Y5xQNI5ylMhEV0mro2SOq2S6q6TFVVJjRZR2lXS4Sl51lWxzlWxTIruTjmSVFdbH71le6SLFvIV50wrqslN+hKNAa6jy1FRX5DxHyTtdJctdJVNdpWrdQ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+YiFO9HcyoBLWD/T2feSmVQ7CTgCeABFP9Hlvbo6zWcWmVcwJwGDUHa1wq6NiVufGhiVfunlNAGEGj2Z/1g7x/daxYP33LFU4cSjrymRKaY47orF+jXRlygmJgxMuaJ3eYvbgQGQ+kdmNnw+4B5CEsxjyCMA7IodhOwGdiExy4yBGjAgeZvbDzsvR69tq+9L5f4E0/JDUAiG+g7A60H//vagpaa9kOZ3E0JR90I1OQCfXc20PG/do95wzhqKyUKhKVJY15FZV7YWGphhw1CNH9944jvsa9vQIOsXTGl/omsr2XD7u5sMvKyyj09A2hYt3Ri9c+ygVbrd3b2T6g+Zg9nxsQM4aivlIjS/hdt+WCEHT81f3njmNJ84g+fI1wy5GvNyn8pDIE/fsNzOPZ95UGJ4zExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExR4P/B/wbc2ch2LsLAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE4LTEwLTIwVDIwOjA4OjE4LTA0OjAwJqZspAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOC0xMC0yMFQyMDowODoxOC0wNDowMFf71BgAAAAASUVORK5CYII=" preserveAspectRatio="xMidYMid meet"/></svg>
HTML
<nav class="navbar navbar-expand-md navbar-light bg-light">
<!--<div class="mx-auto d-sm-flex d-block flex-sm-nowrap">-->
<a class="navbar-brand" href="index.html"><img src="img/logo.svg" class="img-fluid" style="width: 100%; height: auto;"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-stretch" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#index.html"><b>Wanzeru</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#content2"><b>Feature</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#content3"><b>Integrating</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#content4"><b>Pricing</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#content6"><b>About</b></a>
</li>
</ul>
</div>
</div>
</nav>
CSS
.navbar-brand{
margin-bottom: -10px;
margin-top:15px;
margin-right: 6rem;
}
.navbar-nav > li{
margin-bottom: -16px;
margin-top: 17px;
margin-right: .7rem;
font-size: 15px;
}
答案 0 :(得分:3)
您必须使用矢量,而不是像素/光栅/位图图像。您的徽标图片是SVG,但其中包含一个嵌入式(基于base64编码的)像素图片:
<image x="0" y="0" width="212" height="69" xlink:href="data:image/png;base64,xyz">
这就是为什么缩放时它变得模糊。确保将图像导出为真实的矢量图形。
Google对向量和像素之间的差异进行了详尽的解释。向量通过坐标系中的几何图案来描述图像-缩放图像不会对质量产生任何影响。