css 背景图片未加载到列表中

问题描述 投票:0回答:1

我正在尝试将带有“之前”标签的背景图像加载到列表中以在列表的后面创建复选标记图像,但图像没有显示。问题是什么?这是代码:

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/style.css">
   


    <title>Document</title>
</head>
<body>
    <div class="container">
        <div class="stylize">
            стилизируй с помощью псевдоклассов и псевдоэлементов
        </div>
        <div class="mainlist">
            <ul class="list1">
                <li>Put on this page information about your product</li>
                <li>A detailed description of your product</li>
                <li>Tell us about the advantage and merits</li>
                <li>associate the page with the payment system</li>
            </ul>
            <ul class="list2"></ul>
        </div>
    </div>
</body>
</html>

和CSS:

.list1 li:before{
    content: '';
    background: url('../img/Без\ названия.png') 0 0 no-repeat;
    width: 20px;
    height: 20px;

理论上,列表应该标有复选标记,或者更确切地说是我使用“背景网址”上传的图像,但没有出现图标

css background-image
1个回答
-2
投票

.list1{list-style: url('img/Без/названия.png');}

在 img/Без

后将反斜杠更改为 '/'
© www.soinside.com 2019 - 2024. All rights reserved.