Drycodez Posted September 22, 2011 Share Posted September 22, 2011 <img src='../img/pic.gif' width='200' height='200' /> In the above, what does HTML use to measure height and width? Is it: px or what? Link to comment Share on other sites More sharing options...
Ingolme Posted September 22, 2011 Share Posted September 22, 2011 Yes, it's in pixels. However, we don't use usually the width and height attributes. We use CSS to give the image a size if necessary. Link to comment Share on other sites More sharing options...
Drycodez Posted September 22, 2011 Author Share Posted September 22, 2011 Yes, it's in pixels. However, we don't use usually the width and height attributes. We use CSS to give the image a size if necessary. yeah, i kinda know its deprecated, but i just wanted to be SURE. Thankx alot Bro! Link to comment Share on other sites More sharing options...
Ingolme Posted September 22, 2011 Share Posted September 22, 2011 The width and height attributes aren't deprecated. They have one purpose. It's not a practise I follow, but it might be actually a good idea to do it. When a large image is loaded and the browser doesn't know its actual size, the browser will use the width and height attributes to reserve space on the page for the image. This is good for people with slow internet connections. The problem with trying to do this with CSS is that you need a new rule for each image and you have to wait for the stylesheet to load before the image's size is determined. Link to comment Share on other sites More sharing options...
Drycodez Posted September 22, 2011 Author Share Posted September 22, 2011 Oopse, my bad! I thought it's deprecated. Cnt even remenber the last time i used those attributes. Thanks for the currection. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.