鍍金池/ 問答/C  網(wǎng)絡(luò)安全  HTML/ img ,寬度設(shè)置100%,圖片會(huì)變模糊。 設(shè)置為固定寬度就很清晰

img ,寬度設(shè)置100%,圖片會(huì)變模糊。 設(shè)置為固定寬度就很清晰

img ,寬度設(shè)置100%,圖片會(huì)變模糊。 設(shè)置為固定寬度就很清晰。
比如一張圖片寬度1920px:
<img src="1920img.jpg" width="100%">
代碼這樣寫圖片會(huì)壓縮的比較模糊。
<img src="1920img.jpg" width="1920px">
這樣固定寬度就不模糊了。。。
請(qǐng)教各位什么原因,如何解決,謝謝

回答
編輯回答
扯不斷
img {
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: -o-crisp-edges; /* Opera */
    image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
}
2017年3月17日 08:54