incorrct image size using CSS height= and width=auto

Posted on 2007-12-06
Last Modified: 2012-06-27
I am building a website using CSS to define a common height to images and letting the browser decide on the width automatically.
The reason is that I have alot of pictures and I do not want to set each one in frontpage.
If you enter the any of the porducts for the first time, the height is correct but the width is not.
Press the link on the left to the same pageg - and it all sorts out ok.
Any ideas what I should do ?
Question by:ggivati
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
LVL 29

Accepted Solution

Göran Andersson earned 500 total points
ID: 20423931
First, get a doctype for your page.

I looked at the page in Firefox and Internet Explorer 7. The size of the images is completely different between the browsers, but I don't see the effect that you describe in any of them.
LVL 18

Expert Comment

ID: 20424152

curious where you found a link to the page?
LVL 29

Expert Comment

by:Göran Andersson
ID: 20424293
In the tags. :)
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users


Author Comment

ID: 20424316
The link is "".
I am using ie 6.
LVL 18

Expert Comment

ID: 20459124
thanks GreenGhost, didn't see that.


you have not yet implemented the doctype suggestion.

Expert Comment

ID: 20953137
Forced accept.

Community Support Moderator

Author Comment

ID: 22646289
It seems the problem is in IE 6. I have written a javascript code to fix width and length of the pictures.

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at Browse or search based on font properties or name to find a suitable font for…

717 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