HTML第五章总结

A Chapter for <img>

前言

这一章讲了 Web 图片 format 的各自的优缺点和elements of 's attributes.

Section1:Q1:How the browser work with images?

  1. First, the Browser retrieve the HTML page, but doesn't get the images.
  2. Then, retrieved the first image, and then moves on to the next image
  3. ...

Section1:Q2: How images work?

There are ONLY 3 formats are commonly used in Web:JPEG,PNG and GIF.

  • JPEG:Work for continuous tone images, and are smaller. But it throw away some information about the image.
  • PNG:Work for images with solid colors, comes in 3 formats:PNG-8,PNG-24 and PNG-32. A lostless format. Smaller than GIF but larger than JPEG.
  • GIF:Work for imagine with solid colors.It can represent images with up to 256 colors. A lossless format. Support transparency. Support animation.

One more thing : PNG can have anti-aliased transparent area but GIF can't.

Section2:Attributes of <img>

  • src="":its value not only can use relative path, but also URL src is short for "source".
  • alt="":If an image can't found, the alt attribute is displayed instead.
  • width="" 和 height="":To size up images.

Section2:Use Photoshop to make changes

Because big image can make your page slow to load, and attribute width="" &height=""doesn't change the file storage. So, you'd better crop it and even make some thumbnails to see a lager version of the image.

For JPEG(photos)
: there are some options needed to change:

  • Format :JPEG
  • Quality:Medium is OK
  • New size: less than 800px:Browsers are 800px ~1200px wide, so the width should less than 800 px.

For PNG(Logo)

  • Format :PNG-8
  • Colors:256 is OK
  • Transparency:checked
  • Matte :with the background color

One more thing:
Notice the small box:

It shows times and storage. 





转载于:https://www.cnblogs.com/FBsharl/p/10027286.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值