Jump to content
  • Sign Up
  • 0

Не понимаю, что сделал не так.


masloy
 Share

Question

Здравствуйте, не понимаю что происходит, максимально простое решение, добавить бэк через css. Сделал класс и прописал в css всё. Не работает, проверил 1000 раз всё, не работает. Код html

<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <link rel="stylesheet" href="style.css">
</head>
<body>
        <div class="content">
        </div>
</body>
</html>

И вот код css

.content{
        background: url('img/back_header.jpg');
}

путь к картинке D:\web\Flaby\img

 

Уже не первый день борюсь, через html подключаю картинку по этому пути, через css не могу. 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

В блоке .content есть вообще содержимое? Если нет, то у него нулевая высота, может из-за этого не отображаться. Либо проверяйте пути: здесь у вас относительный путь, может быть не туда ведет.

Link to comment
Share on other sites

  • 0

Разве не к BODY надо прикреплять?

<style>
   body {
    background-image: url(images/help.png); /* Путь к фоновому изображению */
    background-attachment: fixed; /* Фиксируем фон веб-страницы */
   }
  </style>

http://htmlbook.ru/css/background-attachment

Edited by SergeAnt
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy