Home > Article > Web Front-end > Why can’t the imported css images be loaded?
Reasons why it cannot be loaded: 1. The css code is written incorrectly; 2. The import address of the css image is incorrect; 3. The width and height of the html container (for example, div) containing the css image are not set to fixed values, css The picture will not open the element container; 4. The HTML code is not written in a standardized way; 5. The element that introduces the css picture does not have the block attribute.
#The operating environment of this tutorial: Windows 7 system, css3 version, Dell G3 computer.
Recommended: css video tutorial
If you want to introduce images in CSS, you can use the background attribute or background-image attribute. Either the background attribute or the background-image attribute can add a background image.
But sometimes the imported css image (background image) cannot be loaded. What is the reason?
Possible reasons are:
1. The css code is written incorrectly. Wrong writing will of course not be displayed.
2. The import address of the css image is wrong
3. The width and height of the html container (such as div) containing the css image do not have fixed values, and the css image will not expand the element
4. The element does not have block attributes. The height and width set when the element does not have the block attribute are invalid. Therefore, the image will not be displayed
5. The HTML code is not written in a standardized manner
6. It is overwritten by the style of the css class with the same name. Assume that the background display image is set with the name .bg in the front, and the background display color is set with the name .bg later.
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of Why can’t the imported css images be loaded?. For more information, please follow other related articles on the PHP Chinese website!