,即使在图像显示之前。如果没有WIDTH / HEIGHT, 浏览器有时会渲染以下文本,好像没有图像 ,然后在知道图像尺寸时重新计算布局。 /> 另外,知道这也可以帮助我优化页面以加快加载速度。 How does a browser parse (correct term?) an HTML document. I''m sure that every browser does it a little differently. Do they simply just read a document top-to-bottom and left-to-right and just display elements in the order in which they encounter them? Or, do they give priority to certain types of content? For instance, would a browser display text first, then all the images, then all Javascripts, etc? Say, for example, I had a large image (let''s say 1MB). The image is floated left of my paragraph, so this is my code: <img src="image.jpg" style="float: left"> <p> blah blah blah, yadda yadda yadda </p> Would a browser just load these in order, so I would have to wait for the 1MB image to load, then I''d see the text?The image will be downloaded in the background while the rest of thedocument is loaded/parsed (same happends for other external files likestylesheet, applets... but not JavaScript files AFAIK). If there would beWIDTH and HEIGHT attributes for the image, then the browser could reservethe right amount of space on the page and the following text can flowaround it, even before the image is displayed. Without WIDTH/HEIGHT thebrowser will sometimes render the following text as if there is no imageand then recalculate the layout when it knows the dimensions of the image. Also, knowing this would also help me optimize pages to load faster. 如果你在图像中指定WIDTH / HEIGHT,那么其他的东西就在您的页面 在浏览器重新计算布局时不会跳。速度 改进可能很小,但它看起来更顺畅。 - Benjamin Niemann 电子邮件:粉红色at odahoda dot de WWW: http:/ /www.odahoda.de/>如果您错过了关于Uni课程的alt。 www.webmaster 上的帖子,请> If you missed the thread on alt.www.webmaster about Uni classes, have a阅读网页设计教师几天前: < http://groups.google.com/group/alt.www.webmaster/browse_frm/thread/9260ab7b04c2a812/2c3e5a604de2f532?tvc = 1& q = web + design + teachers + alt.w ww.webmaster& hl = en#2c3e5a604de2f532> read of "Web Design Teachers" from a few days ago: <http://groups.google.com/group/alt.www.webmaster/browse_frm/thread/9260ab7b04c2a812/2c3e5a604de2f532?tvc=1&q=web+design+teachers+alt.w ww.webmaster&hl=en#2c3e5a604de2f532> 呀!哇...我不知所措。 Viken K.Yikes! Wow...I''m at a loss for words.Viken K. 这篇关于浏览器如何解析html文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!