I used to display a picture normally in Firefox, but it was very gray in IE. I asked why ie was so spam, and the guy next to me replied:
Because ie wants to provide development opportunities for other browser vendors. The answer is so incisive!
There are various problems that cannot be normally displayed in IE, mainly because we have developed Firefox as a test tool during the development process. We use Firefox as a testing tool because Firefox has powerful debugging functions and is an indispensable tool for developers. In addition, Firefox provides better support for W3C standards, as long as the display in Firefox is normal, other browsers (except IE) are basically normal.
Now, the image cannot be displayed normally. First, let's take a look at my original code: HTML code:
CSS style sheet:
.ecmEvaluationStar .startOnClass{ background-image: url("images/star-on.gif"); background-repeat: no-repeat; text-align: center; width: 20px; height: 20px; display: inline-block;}
Here, the Golden Star is normally displayed under Firefox, but cannot be normally displayed under ie. Why? Let's take a look at the IMG Tag defined under W3C standards:
The IMG element embeds an image into the webpage.
Note: Technically, the label does not insert images into the webpage, but links images from the webpage. A tag creates a placeholder space for the referenced image.
A tag has two required attributes: the src attribute and
ALT attribute.
Here, the golden star we show is to display the image by setting the background, rather than embedding the image through the IMG label. In IE, when the parser parses the IMG tag, it will definitely find the src attribute. If this attribute cannot be found, it will parse an exception. Firefox parses the IMG label as a div element if the src attribute cannot be found. In the same code above, the image display is different because the IMG Tag lacks the src attribute and different browser resolution methods are different. If you change the above Code to the following code, this is not the case. <Span Height = "20" width = "20" class = "startoffclass" Title = "$ {resboundle. firstscore} "> </span> edited by the author: Firefox implements a user-friendly design for tag parsing, reducing the possibility of program errors, however, it is easy for beginners to pursue the display of functions, while ignoring the encoding specifications.