Home > Web Front-end > CSS Tutorial > What should I do if the referenced image in the css file is not displayed?

What should I do if the referenced image in the css file is not displayed?

王林
Release: 2020-11-16 09:12:17
Original
5043 people have browsed it

Solution to the problem that the picture referenced in the css file is not displayed: 1. Make sure the picture path is written correctly; 2. Set the picture to be displayed in blocks; 3. Specify the width and height of the picture. The correct code is: [display:block;width: 25px;height: 21px;].

What should I do if the referenced image in the css file is not displayed?

Solution:

1. Make sure the path is correct

2. Display in blocks

3 , specify width and height

(recommended tutorial: css video tutorial)

Code:

.icon-document {
        background-image: url(../image/document.png);
        display:block;
        float: left;
        width: 25px;
        height: 21px;
    }
Copy after login

Picture:

What should I do if the referenced image in the css file is not displayed?

Related recommendations: CSS tutorial

The above is the detailed content of What should I do if the referenced image in the css file is not displayed?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template