好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

如何控制图像大小,width和height不起作用?

很多浏览器有自适应显示网页的功能,包括图像,但是这不是一般标准。

因此构造网页时不应该依赖于浏览器的自适应功能。

那直接简单使用width属性和height属性来调整页面上的图像的大小就可以了呢?

其实不然,浏览器在缩放图像使之适应配置的参数时,仍然需要获取整个大图像。

width和height属性其实规定了浏览器要为图像预留多大的空间来显示。

如果需要使用这两个属性,应当与图像的实际宽度和高度的大小一致。

而且如果图像太大,不但拖慢了加载速度,也会造成网页出现错位,甚至无法加载的情况。


最好的方法是什么呢?

首先使用图像处理软件如photoshop或gimp等调整图像大小,再使用width和height规定大小。

这样不但加快网页加载速度,也可以更好的控制网页的显示。

如果仍旧需要输出大图像,可以单独放到一个网页,使用缩略图的方法链接到大图像页。

缩略图一般放到一个名为thumbnails的文件夹里,缩略图名称不变,或者添加thumbnail字符串。

图像宽度最好小于800像素,这是最好的经验。

点赞2
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
tobepartridge
 tobepartridge 约 2 小时前回复
#237
<a href="http://www.atrapaniapp.com/femmes-asics-gel-kinsei-5-oranger-gris-chaussuresl">femmes asics gel kinsei 5 oranger gris</a> <a href="http://www.maplebeyond.com/herren-nike-air-force-1-wei%C3%9F-gr%C3%BCn-schuhei">herren nike air force 1 wei脽 gr眉n</a> <a href="http://www.collisionsix.com/air-jordan-retro-3-dam%C3%A4nner-silber-minzgr%C3%BCn-schuheh">air jordan retro 3 dam盲nner silber minzgr眉n</a> <a href="http://www.todololitas.com/air-jordan-retro-13-kvinners-gull-r%C3%B8d-obuvj">air jordan retro 13 kvinners gull r酶d</a> <a href="http://www.jcwjrlaw.com/maschio-asics-gel-noosa-tri-8-blu-gituttio-scarpek">maschio asics gel noosa tri 8 blu gituttio</a> <a href="http://www.vstsblog.com/femmes-adidas-zx-750-hommesthe-verte-chaussuresh">femmes adidas zx 750 hommesthe verte</a>
tobepartridge http://www.tobepartridge.com/
hardcoreboris
 hardcoreboris 约 4 小时前回复
#236
<a href="http://www.taiwanmeinet.com/adidas-16.3-tf-cleats-bianca-oro-nero-scarpei">adidas 16.3 tf cleats bianca oro nero</a> <a href="http://www.talkwithgirl.com/nike-mercurial-superfly-fg-cleats-verde-negro-zapatosh">nike mercurial superfly fg cleats verde negro</a> <a href="http://www.mamatale.com/nike-zoom-winflo-3-kvinders-hvid-himmelbl%C3%A5-skok">nike zoom winflo 3 kvinders hvid himmelbl氓</a> <a href="http://www.strongtale.com/kvinner-air-jordan-retro-4-svart-r%C3%B8d-obuvi">kvinner air jordan retro 4 svart r酶d</a> <a href="http://www.iranpayamco.com/adidas-projoator-sl-trx-fg-zapatosl">adidas projoator sl trx fg</a> <a href="http://www.hapeid.com/ray-ban-rb2132-new-wayfarer-sunglasses-622-black-rubber-sunglassesh">ray ban rb2132 new wayfarer sunglasses 622 black rubber</a>
hardcoreboris http://www.hardcoreboris.com/
abobaday
 abobaday 约 6 小时前回复
#235
<a href="http://www.houstonujc.com/femminile-adidas-yeezy-boost-350-vino-schuhed">femminile adidas yeezy boost 350 vino</a> <a href="http://www.jetsonpress.com/nike-free-tr-bambini-gituttio-argento-scarpea">nike free tr bambini gituttio argento</a> <a href="http://www.masadablog.com/hommes-nike-free-flyknit-5.0-jaune-blanc-kurpese">hommes nike free flyknit 5.0 jaune blanc</a> <a href="http://www.soknorealtor.com/black-richard-sherman-limited-jersey-womens-25-nike-nfl-san-francisco-49ers-salute-to-service-therma-long-sleeve-nflr">black richard sherman limited jersey womens 25 nike nfl san francisco 49ers salute to service therma long sleeve</a> <a href="http://www.donnaemendoza.com/free-run-2-gr%C3%A5-kurpesf">free run 2 gr氓</a> <a href="http://www.erneyapi.com/nike-air-max-2015-or-rouge-schuhef">nike air max 2015 or rouge</a>
abobaday http://www.abobaday.com/
maryland knit hat
 maryland knit hat 约 18 小时前回复
#234
<a href="http://www.retailnav.com/air-jordan-cp3-naranja-negro-zapatosl">air jordan cp3 naranja negro</a> <a href="http://www.merleflugge.com/air-jordan-eclipse-orange-gold-shoesk">air jordan eclipse orange gold</a> <a href="http://www.airfarelinks.com/under-armour-curry-1-low-all-oransje-obuvi">under armour curry 1 low all oransje</a> <a href="http://www.vidiyow.com/mennns-nike-air-max-bw-bl%C3%A5-gr%C3%B8nn-obuvk">mennns nike air max bw bl氓 gr酶nn</a> <a href="http://www.quiveutdescds.com/air-jordan-1-svart-hvit-gr%C3%A5-obuvi">air jordan 1 svart hvit gr氓</a> <a href="http://www.wapkaa.com/air-jordan-retro-4-arena-pattern-zapatosl">air jordan retro 4 arena pattern</a>
[url=http://www.theuonline.com/maryland-knit-hat-hatj]maryland knit hat[/url]
thumbglovepro
 thumbglovepro 2019-04-18 17:04回复
#233
<a href="http://www.yogafriendly.com/nike-air-max-stefan-janoski-blu-scarpeh">nike air max stefan janoski blu</a> <a href="http://www.btvspassion.com/utah-jazz-hardwood-classic-jersey-nfli">utah jazz hardwood classic jersey</a> <a href="http://www.trusejenta.com/hombres-nike-air-max-tailwind-6-blanco-azul-zapatosh">hombres nike air max tailwind 6 blanco azul</a> <a href="http://www.chatgroupies.com/jordan-12-custom-rojo-zapatosk">jordan 12 custom rojo</a> <a href="http://www.tamarindoyam.com/north-face-cloud-venture-jacket-womens-northfaceh">north face cloud venture jacket womens</a> <a href="http://www.tinaandcoco.com/adidas-neo-m%C3%A4nner-schwarz-schuhek">adidas neo m盲nner schwarz</a>
thumbglovepro http://www.thumbglovepro.com/
trademelikes
 trademelikes 2019-04-18 16:42回复
#232
<a href="http://www.gardensbyruth.com/kobe-9-high-schwarz-volt-anthracite-gold-kurpesf">kobe 9 high schwarz volt anthracite gold</a> <a href="http://www.batemanafrica.com/adidas-prougeator-vert-and-jaune-schuhed">adidas prougeator vert and jaune</a> <a href="http://www.tritechems.com/kd-trey-5-low-top-infrarouges-obuvg">kd trey 5 low top infrarouges</a> <a href="http://www.malocalguide.com/nike-blazer-poison-gr%C3%B8n-kurpesf">nike blazer poison gr酶n</a> <a href="http://www.indeeprecords.com/air-jordan-retro-14-b%C3%B8rn-gr%C3%A5-gul-kurpesf">air jordan retro 14 b酶rn gr氓 gul</a> <a href="http://www.clearancedept.com/nike-free-5.0-hombres-negro-gray-schuheg">nike free 5.0 hombres negro gray</a>
trademelikes http://www.trademelikes.com/
jrsmetalsinc
 jrsmetalsinc 2019-04-18 12:09回复
#231
<a href="http://www.uagogo.com/adidas-neo-canvas-svart-gr%C3%B8nn-obuvj">adidas neo canvas svart gr酶nn</a> <a href="http://www.dannyishere.com/nike-lebron-soldier-10-nero-bianca-scarpel">nike lebron soldier 10 nero bianca</a>
jrsmetalsinc http://www.jrsmetalsinc.com/
pcforecasting
 pcforecasting 2019-04-18 08:58回复
#230
<a href="http://www.alquranschool.com/nike-womens-jalen-richard-limited-black-jersey-oakland-raiders-nfl-30-2016-salute-to-service-nflw">nike womens jalen richard limited black jersey oakland raiders nfl 30 2016 salute to service</a> <a href="http://www.ametinakar.com/womens-nike-philadelphia-eagles-26-jay-ajayi-black-name-number-logo-slim-fit-t-shirt-nflx">womens nike philadelphia eagles 26 jay ajayi black name number logo slim fit t shirt</a> <a href="http://www.bambubaits.com/nike-air-max-90-classic-obsidian-azul-denim-kurpesa">nike air max 90 classic obsidian azul denim</a> <a href="http://www.gogogeeky.com/nike-free-run-3.0-minzgr%C3%BCn-dam%C3%A4nner-butyg">nike free run 3.0 minzgr眉n dam盲nner</a> <a href="http://www.maxfornet.com/mens-nike-new-york-jets-40-trenton-cannon-game-navy-blue-alternate-nfl-jersey-nflw">mens nike new york jets 40 trenton cannon game navy blue alternate nfl jersey</a> <a href="http://www.pandrosos.com/nike-roshe-run-floreale-rosa-bianca-butye">nike roshe run floreale rosa bianca</a>
pcforecasting http://www.pcforecasting.com/
beckyhasaplan
 beckyhasaplan 2019-04-16 21:31回复
#229
<a href="http://www.dominiogold.com/nike-hyperdunk-2016-low-red-shoesi">nike hyperdunk 2016 low red</a> <a href="http://www.saaqlabaie.com/nike-air-max-97-rosado-injection-zapatosi">nike air max 97 rosado injection</a> <a href="http://www.acheidf.com/adidas-16.3-hvid-gr%C3%A5-sort-skoh">adidas 16.3 hvid gr氓 sort</a> <a href="http://www.jrsmetalsinc.com/nike-roshe-2-bianca-scarpei">nike roshe 2 bianca</a> <a href="http://www.kumowindham.com/adidas-yeezy-350-boost-v2-nero-and-bianca-scarpej">adidas yeezy 350 boost v2 nero and bianca</a> <a href="http://www.waybeyondeli.com/lebron-james-black-pride-swingman-jersey-nflh">lebron james black pride swingman jersey</a>
beckyhasaplan http://www.beckyhasaplan.com/
collisionsix
 collisionsix 2019-04-16 02:24回复
#228
<a href="http://www.thebiarritz.com/polo-ralph-lauren-dip-dyed-linen-button-down-shirt-regular-fit-poloh">polo ralph lauren dip dyed linen button down shirt regular fit</a> <a href="http://www.voydnet.com/mens-nike-air-presto-purple-pink-shoesi">mens nike air presto purple pink</a> <a href="http://www.foneandlone.com/nike-air-max-90-premium-silver-white-shoesk">nike air max 90 premium silver white</a> <a href="http://www.roomwhiz.com/adidas-soccers-sko-gr%C3%B8nn-gull-obuvq">adidas soccers sko gr酶nn gull</a> <a href="http://www.riffsurfers.com/herre-nike-sb-stefan-janoski-max-alle-lilla-skoj">herre nike sb stefan janoski max alle lilla</a> <a href="http://www.davidmgaines.com/nike-air-max-zero-verde-rosa-scarpeq">nike air max zero verde rosa</a>
collisionsix http://www.collisionsix.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸