473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

<img> display with height and width attributes

Hello,
Mozilla (suite and Firefox) ignore the height and width attributes of
<img> when the image itself is unavailable (404); only enough space is
allocated for the alt text.
Is this expected behavior for Standards mode?

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 29 '05 #1
4 2578
In article <1J********************@giganews.com>,
Jim Moe <jm***************@sohnen-moe.com> wrote:
Mozilla (suite and Firefox) ignore the height and width attributes of
<img> when the image itself is unavailable (404); only enough space is
allocated for the alt text.
Is this expected behavior for Standards mode?


Yes.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 29 '05 #2
Jim Moe <jm***************@sohnen-moe.com> wrote:
Mozilla (suite and Firefox) ignore the height and width attributes of
<img> when the image itself is unavailable (404); only enough space is
allocated for the alt text.
Is this expected behavior for Standards mode?


There's no such thing as "expected behaviour". The behaviour is
undefined as per the specifications, thus Mozilla is neither wrong nor
right.

--
Spartanicus
Jul 29 '05 #3
Jim Moe wrote:
Hello,
Mozilla (suite and Firefox) ignore the height and width attributes of
<img> when the image itself is unavailable (404); only enough space is
allocated for the alt text.
Is this expected behavior for Standards mode?


Jim,

Ambiguous.

The spec says (section 13.2), "The alt attribute specifies alternate
text that is rendered when the image cannot be displayed (see below for
information on how to specify alternate text ). User agents must render
alternate text when they cannot support images, they cannot support a
certain image type or when they are configured not to display images."
:
"Please consult the section on the visual presentation of objects,
images, and applets for information about image size, alignment, and
borders."

And that section (13.7) says, "When specified, the width and height
attributes tell user agents to override the natural image or object size
in favor of these values."

So it's a question of whether rendering alternate text supersedes or
replaces the overriding of natural image size (which is unknown in the
case you describe) by the height and width parameters.

If all of the ambiguities in the HTML specs were laid end to end....

Chris Beall, who prefers the Mozilla interpretation.

Jul 29 '05 #4
Jim Moe wrote:
Hello,
Mozilla (suite and Firefox) ignore the height and width attributes of
<img> when the image itself is unavailable (404); only enough space is
allocated for the alt text.
Is this expected behavior for Standards mode?

Thanks for your responses. Yes, the spec was curiously silent on this
aspect.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 29 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MyndPhlyp | last post by:
I've been busting my head trying to figure this out for quite some time. With IE6 and NS7, no problems. I can simply code the HTML <img height="100%"> and be done with it. But NS4 and NS6 (and...
2
by: David D. | last post by:
If an <IMG> specifies a WIDTH but not a HEIGHT, then height is internally determined so as to maintain the image's aspect ratio. Aspect ratio is also preserved if HEIGHT but not WIDTH is...
9
by: Wladimir Borsov | last post by:
As well known for <IMG ...> tags in web pages a width and a height attribute can be applied. What I want to do now is to fix the width for ALL the images on my web page to exactly lets say 70 pixel...
5
by: homecurr | last post by:
I am writing a tool to generate html and have a problem with the <img> tag. The tool generates something like "<img src="...">". At the time the html is generated, the tool does not know the actual...
15
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width:...
10
by: News | last post by:
I am trying to be able to manipulate the width and height of an <img> but do not seem to be able. "Yes", I know the JavaScript will "not" manip anything, which is ok. I simply do not know how to...
1
by: Carl | last post by:
Hi all I have a javascript function that drags and drops an element (ie img) into a container (ie bordered div). The function works and returns the element and and container. My next step is to...
4
by: bgold12 | last post by:
Hey, I've come across a strange behaviour that shows itself in IE 7.0 and Firefox 3 and probably other browsers. In the code below, which is a complete HTML document which validates as XHTML 1.0...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.