Why doesn't the background I set appear?
残刀殉菊
残刀殉菊 2018-08-14 20:03:29
0
2
1207

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>Title</title>
</head>
<body >
<div style="background-image: url('C:\Program Files\JetBrains\PhpStorm 2017.3\mn.jpg')">你好</div>
</body>
</html>

残刀殉菊
残刀殉菊

reply all(2)
漫步

I am also a beginner, and I have two understandings about this problem

The first one: the picture path, you need to make sure that the picture path is indeed correct, and generally we use relative paths instead Non-absolute path

Second: Your div does not define width and height, so I personally think it is normal that the background is not displayed

  • reply Thank you, I found the reason, it's a browser problem
    残刀殉菊 author 2018-08-21 10:08:09
秋香姐家的小书童

Picture background Did you put the C drive?

The only reason why the background does not appear is that the path is incorrect. Check the path.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template