HTML背景重复,未用CSS修复



这是原始代码 https://jsfiddle.net/m6mb99z5/

<!DOCTYPE HTML>

<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
<title>todo-list</title>
<!-- this is for the tab icon -->
<link type="tabicon" rel="shortcut icon" href=".ico">
<!-- this is for google font links -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">
<!-- this is for fontawesome.io icons -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- this is bs CSS link min CDN -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- this has to be below bootstrap so you can overwrite there css -->
<link type="text/css" rel="stylesheet" href="todo-list.css">
</head>

待办事项列表

  • 十 去魔药课
  • X 购买新长袍
  • X 拜访海格
<!-- get this from jquery (uncompressed ver.) / this must be at the body of the body to run  -->

我已经尝试了我在 CSS 中知道的所有内容,并在谷歌上搜索了问题并在此处查找了一些问题。 它只是重复,就好像它只是在 html 文档的中间被切断一样。这很可能是我无法弄清楚的非常简单的事情。

这修复了它

body {
font-family: roboto;
background: no-repeat center center fixed; 
background-image: linear-gradient( 135deg, #FFF6B7 10%, #F6416C 100%);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;    
}

最新更新