Quick question about specifying the size of images in pixels:
I would continue to specify the size in pixels. You probably don't need to, but I think you're supposed to according to web standards. Specifying the size in pixels is definitely not going to hurt your code, so leave it there.
I usually leave it out. As not often is the case I use <img>
elements. But, it is better practice to place the width and height in the <img>
tag so the browser doesn't have to calculate these dimensions.
Could not find any information that verifies this but I would use integers without a unit (if not percentage) in HTML and use "px" in CSS, except for zero values where it´s more correct to leave out the unit.
http://www.w3.org/TR/CSS2/visudet.html#the-width-property
As far as I know, you do not add the px
label to width/height attribute values on the img
tag itself, and I believe (though could be wrong) it's because pixels are used regardless. In CSS, however, one may use different units to specify width and height, therefore it is appropriate to add the label when using CSS.
Use css to consider the the size of the image:
CSS:
.logo {
width: 200px;
height: 120px;
}
HTML:
<img src="/logo.jpg" alt="logo" class="logo" />