|
![]() |
#1 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2011
Location: ,
Posts: 51
|
![]() Does this go here?
I'm doing some light work with HTML and images for an assignment. In IE and Chrome, if the images fail to load, the alt text displays inside a box with the same dimensions as the image, as long as the width and height attributes are set. In Firefox the alt text displays as a line of regular-looking text. I would prefer users to know that there is supposed to be an image there. Is this my fault or the browser's? |
||
![]() ![]() |
|
![]() |
#2 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: ,
Posts: 4,613
|
![]() I think it goes in the Programming subforum.
You could attach example code in a small HTML file so we could test and look inside, but Quote:
BUT I doubt that any of those browsers is wrong about such a basic thing. I think it's likelier that there's something wrong with the code, and then some browsers are more robust in tolerating and interpreting deviations from the HTML standard. Let me guess, are you using quotation marks around every attribute value? The standard is double quotation marks, maybe single ones are just as good, but to be sure it should look like this, please note all the quotation marks: HTML Code:
<img src="/images/foo.png" alt="This is an image" width="400" height="300"/>
HTML Code:
<img src="/images/foo.png" alt="This is an image" width="400" height="300" />
__________________
Life starts every day anew. Prospects not so good... |
||
![]() ![]() |
|
![]() |
#3 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2011
Location: ,
Posts: 51
|
![]() Thanks. I tried the whitespace thing, but no difference. One requirement for the assignment is that the code must validate as XHTML 1.0 Strict. If it doesn't, I get zero. So I think I've been quite anal about code correctness. Still, there's always room for things to go wrong.
Sample code: HTML Code:
<div id="header"> <div id="logo"><img src="Webdoken logo.png" alt="Webdoken logo" width="243" height="73" /></div> <h1>Webdoken™</h1> <p>Reducing Internet idiocy one punch at a time </p> </div> Most of my Firefox testing has been with 3.6.13, although I'm quite sure I've also tested it with 3.6.15. |
||
![]() ![]() |
|
![]() |
#4 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: ,
Posts: 4,613
|
![]() It looks simple enough, whatever causes this must be in the CSS. Try not applying the CSS (for example remove the divs), and if then the image void displays with the correct size in FF, you can start hunting down the line that causes this behavior.
By the way I think it's better to use entity codes to display symbols such as the trademark sign, to avoid trans-encoding problems: HTML Code:
<h1>Webdoken™</h1>
__________________
Life starts every day anew. Prospects not so good... |
||
![]() ![]() |
|
![]() |
#5 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2011
Location: ,
Posts: 51
|
![]() HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>blah</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body> <p><img src="Webdoken logo.png" alt="Webdoken logo" width="243" height="73" /></p> </body> </html> BTW, the trademark symbol started out as an entity. Last edited by wackypanda; 02-04-2011 at 05:36 AM. |
||
![]() ![]() |
|
![]() |
#6 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2006
Location: ,
Posts: 4,613
|
![]() Quote:
http://www.w3.org/TR/xhtml1/dtds.htm...strict.dtd_img By the way, it seems the space before "/>" is now part of the standard for some reason: http://www.w3.org/TR/xhtml1/#C_2
__________________
Life starts every day anew. Prospects not so good... |
||
![]() ![]() |
|
![]() |
#7 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2011
Location: ,
Posts: 51
|
![]() There is this Mozilla bug report from 1998, which confirms that this behaviour is (was?) intended. I haven't found out if this is due to W3C specs, although the conversation in the report implies that it was the spec back then.
Edit: Seems it is also a HTML5 spec, although that spec recommends that a missing image icon be displayed as well. As it is, a CSS extended property has to be added (but darned if I can figure out where) to force the icon to appear. Last edited by wackypanda; 03-04-2011 at 11:15 AM. |
||
![]() ![]() |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Restoring original display | FlyingTritons | Tech Corner | 13 | 06-03-2011 06:24 PM |
public display of affection | stinker | Music, Art, Movies | 6 | 12-07-2009 06:52 PM |
Display Adaptors | Wade | Tech Corner | 7 | 18-08-2006 06:22 AM |
Settlers 2 Ge Display Problem | Kenta | Troubleshooting | 5 | 11-12-2005 03:22 PM |
|
|
||
  |