admin管理员组文章数量:1336632
hey guys i was building on of the web app and Image in my webpage looks blurry even if it is high resolution. can you guys help me to fix it?
as you can see here, it looks blurrry.
Here is my code:
#album-cover img{
position: absolute;
top: 15px;
}
<img src = {name.imageURL} width = "150" height = "150"/>
hey guys i was building on of the web app and Image in my webpage looks blurry even if it is high resolution. can you guys help me to fix it?
as you can see here, it looks blurrry.
Here is my code:
#album-cover img{
position: absolute;
top: 15px;
}
<img src = {name.imageURL} width = "150" height = "150"/>
how can i fix this? thank you
Share Improve this question edited Dec 11, 2020 at 9:20 maxime1992 23.8k11 gold badges87 silver badges130 bronze badges asked Dec 11, 2020 at 4:36 DjBillje OfficialDjBillje Official 3862 gold badges4 silver badges18 bronze badges 1- Upload image separately, or upload on net, and provide link here. – Deadpool Commented Dec 11, 2020 at 4:38
4 Answers
Reset to default 3What site are you working on? i meant what platform? If you have a high res-image and then resize it using CSS, chances are that it will turn blurry, whereas if you crop it or resize it manually to 150px x 150px and upload it, it will retain its sharpness even if you omit the width and height in css like this:
The problem may e from your styling. You are setting the size of the image 150x150, which may be different from the original ratio. Since the image must be resize to that ratio it could lead to this behavior.
You may either try to use only width
or height
and let the other property auto calculated, or you can try using max-height
or max-width
instead. Another solution is that you can resize the image using some library before display it.
Insert this line in your styling for the image. When images are being downscaled (or upscaled), an image rendering algorithm has to be used. The line below specifies this rendering algorithm to one that looks clear.
image-rendering: pixelated;
Check this link out: https://www.w3schools./cssref/css3_pr_image-rendering.asp
set the object-fit property to cover. This will not mess with the resolution of the image.
本文标签: javascriptWhy is my image in html looks blurry even tho the image resolution is highStack Overflow
版权声明:本文标题:javascript - Why is my image in html looks blurry even tho the image resolution is high - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742405495a2468734.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论