Solved

Width and Height specifications

Posted on 2012-03-28
5
290 Views
Last Modified: 2012-03-30
Hi,
When specifiying an image in an HTML document , should the width and heigh be specified?

as a submit:
<input name="save" type="image"   src="images/saveButton.jpg"  width="20" height="10" alt="Save Button" />

or as as a regular image:

<img src="images/SumPaymentTab.jpg" alt="Payment Information" width="888" height="37" />

Or as a link:
<a href="AMbilling.cfm?fpage=menu"><img src="images/EditButton.jpg"
               alt="Edit Billing Information" width="86" height="28" border="0"/></a>



I read this is a "best practice as the Browser reserves space as it loades the page BUT when I change a buuton used in many pages, I don't want to have to change the dimensions?

Thanks in advance,
hefterr
0
Comment
Question by:hefterr
  • 3
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 500 total points
ID: 37779737
nevermind about image dimensions, if you have the images with the proper dimensions.
It isn't required. It can optimize, eventually --- minimizing page load times, but the difference is negligible, if noticeable.
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37779742
PS: IMHO, less coding is also optimization: if you don't put the dimensions, that's about 26 characters less for any given image.
0
 
LVL 1

Author Comment

by:hefterr
ID: 37779830
Hi designatedinitializer,
Thanks for the reply.  I'm not sure what you meant by :
>> It can optimize, eventually  ??

hefterr
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37780464
what I mean is that it may be true that the browser loads the page a little bit faster if you provide width and height in advance, but I have my doubts.
0
 
LVL 1

Author Closing Comment

by:hefterr
ID: 37788210
Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now