Solved

Width and Height specifications

Posted on 2012-03-28
5
292 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

776 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