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

迷津渡口

越感到迷惑 越接近真理

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

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

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

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

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

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

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

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


最好的方法是什么呢?

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

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

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

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

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

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

清空信息
关闭评论
revarepair
 revarepair 约 21 小时前回复
#109
<a href="http://www.javlust.com/air-jordan-12-schuhe-for-verkauf-kurpesg">air jordan 12 schuhe for verkauf</a> <a href="http://www.postmatespro.com/nike-air-huarache-iii-r%C3%B8d-gr%C3%B8n-obuvb">nike air huarache iii r酶d gr酶n</a> <a href="http://www.uilstrategie.com/nike-roshe-run-space-azul-comprar-butya">nike roshe run space azul comprar</a> <a href="http://www.youtubetune.com/nfl-womens-nike-pittsburgh-steelers-63-dermontti-dawson-black-camo-salute-to-service-t-shirt-nflu">nfl womens nike pittsburgh steelers 63 dermontti dawson black camo salute to service t shirt</a> <a href="http://www.carbonstalk.com/a-buon-mercato-jordan-7-for-vendita-kurpesb">a buon mercato jordan 7 for vendita</a> <a href="http://www.gospeedbird.com/kobe-9-r%C3%B8d-crimson-gull-schuhec">kobe 9 r酶d crimson gull</a>
revarepair http://www.revarepair.com/
rongifc
 rongifc 2019-02-15 20:54回复
#108
<a href="http://www.rispaqoutiano.com/adidas-john-wtodas-3-rojo-negro-butya">adidas john wtodas 3 rojo negro</a> <a href="http://www.visualjobads.com/adidas-x-16-purechaos-fg-ag-guld-sort-chaussuresf">adidas x 16 purechaos fg ag guld sort</a> <a href="http://www.jewelsavers.com/nike-flyknit-lunar-1-herren-laufen-schuh-you-tube-butya">nike flyknit lunar 1 herren laufen schuh you tube</a> <a href="http://www.legalguards.com/puma-evospeed-1.4-sl-fg-soccer-boots-cleats-azul-fluorescence-verde-schuheg">puma evospeed 1.4 sl fg soccer boots cleats azul fluorescence verde</a> <a href="http://www.minneimaging.com/ralph-lauren-shorts-gr%C3%BCn-lila-polou">ralph lauren shorts gr眉n lila</a> <a href="http://www.minsonphoto.com/nike-hyperrev-2016-bhm-zapatos-chaussuresa">nike hyperrev 2016 bhm zapatos</a>
rongifc http://www.rongifc.com/
roomwhiz
 roomwhiz 2019-02-15 12:17回复
#107
<a href="http://www.atrapaniapp.com/maschio-air-jordan-6-arancia-scarpej">maschio air jordan 6 arancia</a> <a href="http://www.maplebeyond.com/nike-kobe-6-black-white-shoesh">nike kobe 6 black white</a> <a href="http://www.collisionsix.com/nike-zoom-winflo-2-blanco-plata-zapatosk">nike zoom winflo 2 blanco plata</a> <a href="http://www.todololitas.com/hombres-nike-shox-current-gris-blanco-zapatosp">hombres nike shox current gris blanco</a> <a href="http://www.jcwjrlaw.com/north-face-womens-gotham-jacket-grey-northfaceh">north face womens gotham jacket grey</a> <a href="http://www.vstsblog.com/adidas-harden-wei%C3%9F-himmelblau-schuhej">adidas harden wei脽 himmelblau</a>
roomwhiz http://www.roomwhiz.com/
demuslimah
 demuslimah 2019-02-14 20:48回复
#106
<a href="http://www.juraamei.com/bon-march%C3%A9-nike-roshe-run-high-femmes-or-shoesa">bon march茅 nike roshe run high femmes or</a> <a href="http://www.beoshoes.com/nike-mercurial-vapor-superfly-1-skos">nike mercurial vapor superfly 1</a> <a href="http://www.samuelzide.com/ferragamo-belt-colors-beltr">ferragamo belt colors</a> <a href="http://www.zealouslyzika.com/mackage-handbag-blog-da-mackagea">mackage handbag blog da</a> <a href="http://www.tjharkins.com/new-balance-998-eastbay-skow">new balance 998 eastbay</a> <a href="http://www.bringussocial.com/colorado-avalanche-92-gabriel-landeskog-blue-third-jersey-nflg">colorado avalanche 92 gabriel landeskog blue third jersey</a>
demuslimah http://www.demuslimah.com/
thehodostore
 thehodostore 2019-02-14 13:47回复
#105
<a href="http://www.georgesherry.com/dark-blau-and-wei%C3%9F-air-max-90-kurpesa">dark blau and wei脽 air max 90</a> <a href="http://www.jenalgroup.com/nike-kyrie-2-for-sale-uk-sneakerb">nike kyrie 2 for sale uk</a> <a href="http://www.badacamshotel.com/barato-nike-hyperdunk-2015-flyknit-low-mujeres-verde-shoesg">barato nike hyperdunk 2015 flyknit low mujeres verde</a> <a href="http://www.compressmyjs.com/mississippi-beanie-hats">mississippi beanie</a> <a href="http://www.fetison.com/air-jordan-3-outsole-design-for-women-sneakerf">air jordan 3 outsole design for women</a> <a href="http://www.neffloot.com/mennns-mizuno-wave-creation-13-lilla-gr%C3%B8nn-obuvd">mennns mizuno wave creation 13 lilla gr酶nn</a>
thehodostore http://www.thehodostore.com/
kd 8 price
 kd 8 price 2019-02-14 06:37回复
#104
<a href="http://www.iwansulistyo.com/adidas-yeezy-boost-350-dark-gr%C3%B8n-obuvb">adidas yeezy boost 350 dark gr酶n</a> <a href="http://www.frejahedvall.com/oakley-mens-sunglasses-clearance-holes-sunglassesf">oakley mens sunglasses clearance holes</a> <a href="http://www.yanbutravel.com/san-jose-sharks-playoff-hat-hats">san jose sharks playoff hat</a> <a href="http://www.pgcsymposium.com/flyknit-roshe-run-anthracite-sportsa">flyknit roshe run anthracite</a> <a href="http://www.songtruong.com/nike-air-max-tailwind-svart-queen-schuhee">nike air max tailwind svart queen</a> <a href="http://www.szbbjdn.com/seattle-mariners-camo-hat-hatr">seattle mariners camo hat</a>
kd 8 price http://www.baccoating.com/kd-8-price-runninga
shonema
 shonema 2019-02-13 08:36回复
#103
<a href="http://www.sugarforspice.com/herre-air-max-90-em-gul-gr%C3%A5-skok">herre air max 90 em gul gr氓</a> <a href="http://www.mybancorphsa.com/nike-air-max-high-top-rosso-scarpeh">nike air max high top rosso</a> <a href="http://www.scopatore.com/femminile-nike-free-run-3-blu-oro-scarpei">femminile nike free run 3 blu oro</a> <a href="http://www.galacticlogos.com/http-jordan2u-dwyane-wade-miami-nflh">http jordan2u dwyane wade miami</a> <a href="http://www.ispardmore.com/coach-wristlet-singapore-coachh">coach wristlet singapore</a> <a href="http://www.radioramabc.com/adidas-zx-700-oro-nero-scarpeh">adidas zx 700 oro nero</a>
shonema http://www.shonema.com/
daunchbeauty
 daunchbeauty 2019-02-11 21:35回复
#102
<a href="http://www.sigaldavid.com/yeezy-boost-950-rosa-grigio-schuhed">yeezy boost 950 rosa grigio</a> <a href="http://www.souvkaretbdg.com/kyrie-1-gr%C3%B8n-and-guld-today-scarpec">kyrie 1 gr酶n and guld today</a> <a href="http://www.busancitynews.com/demarco-murray-white-jersey-nflw">demarco murray white jersey</a> <a href="http://www.cigarlogbook.com/barcelona-blank-purple-goalkeeper-soccer-club-jersey-nflz">barcelona blank purple goalkeeper soccer club jersey</a> <a href="http://www.dineet.com/nike-zoom-vomero-mujeres-rosado-gris-kurpesa">nike zoom vomero mujeres rosado gris</a> <a href="http://www.glamlustlife.com/femmes-nike-shox-turbo-21-violet-gris-butyg">femmes nike shox turbo 21 violet gris</a>
[url=http://www.daunchbeauty.com/]daunchbeauty[/url]
hiltonskyshop
 hiltonskyshop 2019-02-11 10:31回复
#101
<a href="http://www.snifferwalk.com/north-face-fleece-jacket-womens-northfaceh">north face fleece jacket womens</a> <a href="http://www.fishmackerel.com/dam%C3%A4nner-nike-kd-8-gelb-lila-schuheq">dam盲nner nike kd 8 gelb lila</a> <a href="http://www.lauraenergy.com/air-jordan-retro-9-femmes-gris-rouge-chaussuresl">air jordan retro 9 femmes gris rouge</a> <a href="http://www.magellantt.com/nike-air-force-1-verde-high-zapatosq">nike air force 1 verde high</a> <a href="http://www.sportablecrew.com/nike-free-tr-kvinders-lilla-r%C3%B8d-skoj">nike free tr kvinders lilla r酶d</a> <a href="http://www.digisolnc.com/air-jordan-after-game-rosa-hvit-obuvi">air jordan after game rosa hvit</a>
hiltonskyshop http://www.hiltonskyshop.com/
hangrysquad
 hangrysquad 2019-02-10 11:22回复
#100
<a href="http://www.joalby.com/nike-free-flyknit-5.0-p%C3%BArpura-blanco-kurpesg">nike free flyknit 5.0 p煤rpura blanco</a> <a href="http://www.radiowizi.com/adidas-casual-sko-rosa-gull-obuvb">adidas casual sko rosa gull</a> <a href="http://www.rapamateur.com/kobe-10-jaune-orange-color-butya">kobe 10 jaune orange color</a> <a href="http://www.tuartonline.com/nfl-mens-nike-detroit-lions-35-miles-killebrew-blue-name-number-pullover-hoodie-nflu">nfl mens nike detroit lions 35 miles killebrew blue name number pullover hoodie</a> <a href="http://www.bantathlete.com/nike-kyrie-2-all-hvit-list-kurpesc">nike kyrie 2 all hvit list</a> <a href="http://www.clandessdiner.com/air-jordan-reveal-s%C3%B8lv-hvid-schuhed">air jordan reveal s酶lv hvid</a>
hangrysquad http://www.hangrysquad.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸