Solved

Width and Height specifications

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
CSS/audio questions 2 48
Compare site how does it work 4 52
Element alignment and word wrapping 9 25
Bootstrap 3 and Angular 2 12 24
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

757 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

17 Experts available now in Live!

Get 1:1 Help Now