[英]How can I set the dimensions in an image CDN using CSS?
的CSS
img {
width: 300px;
height: 300px;
}
的HTML
<img src="http://images.xxxxxxx.co.uk/content/icon.png" alt="xxxxxxxxx" />
頁面速度出現相同錯誤
指定圖像尺寸以下圖像缺少寬度和/或高度屬性。
http://images.xxxxxxxxxx.co.uk/content/icon.png (Dimensions: 67 x 75)
有使用.htaccess或jQuery的解決方案嗎?
將它們添加到圖片標簽有什么問題:
<img src="http://images.xxxxxxx.co.uk/content/icon.png" width="67px" height="75px" alt="xxxxxxxxx" />
您無法使用JQuery做您想做的事情,因為搜索引擎/ PageSpeed不會呈現javascript,因此它也不會對爬蟲起作用。
對於CSS來說是相同的,搜尋器(通過PageSpeed進行優化的目的)不會在CSS中運行,因此,如果它用於SEO,那么CSS也不會。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.