以下是我提到图像的唯一代码:
在html和css文件中:
<button type="submit" class="task-item-button">
<img src="{% static 'x.svg' %}" alt="Close icon">
</button>
.task-item-button {
position: absolute;
top: 10px; /* Adjust the top position */
right: 10px; /* Adjust the right position */
width: 20px;
height: 20px;
color: red;
padding: 0;
border: none;
background: none;
border-radius: 8px;
cursor: pointer;
}
.task-item-button img {
width: 20px; /* Adjust the width of the image as needed */
height: 20px; /* Adjust the height of the image as needed */
}
我在最上面有{% load static %}
个.
除此之外,我在任何地方都没有提到过这些图片.
静态的 struct 如下所示:
谢谢你的帮助