作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是一名前端开发人员。我写了一个 HTML 模板,并尝试将该 HTML 模板上传到我的博客上。但是当我试图保存它们时弹出一条消息
(Error parsing XML, line 170, column 3: The element type "link" must be terminated by the matching end-tag "</link>".)
我在整个文件中只有两个用于 google 字体的链接标签。当我删除链接标签并再次尝试保存时,弹出另一条消息:
(Could not load theme preview: Error parsing XML, line 168, column 3: The element type "meta" must be terminated by the matching end-tag "</meta>".)
我不知道如何解决这个问题。如果有人有任何想法,请建议该怎么做。
* {
margin: 0;
padding: 0;
outline: 0;
}
.body {
background: linear-gradient(to right, rgba(0, 4, 51, 0.86), rgb(0, 165, 195));
height: 100vh;
width: 100%;
position: relative;
background-position: center;
background-size: cover;
background-repeat: repeat;
}
.body img {
width: 300px;
margin-top: 30px;
margin-left: 80px;
padding-bottom: 20px;
}
.offer {
display: inline-block;
}
.offer p {
font-family: 'Roboto', sans-serif;
font-size: 58px;
position: absolute;
top: 100px;
right: 17px;
font-weight: 900;
color: #ffffff;
}
.offer a {
position: absolute;
top: 300px;
right: 20px;
font-family: 'Open Sans', sans-serif;
text-decoration: none;
color: #ffffff;
font-weight: bold;
font-size: 30px;
letter-spacing: 2px;
background: #010059;
padding: 20px 15px;
border-radius: 75px;
border: 3px solid #ffffff;
transition: .4s;
}
.offer a:hover {
background: #ffffff;
color: #010059;
}
/*=========== Responsive =============*/
@media (max-width:575px) {
.body img {
width: 172px;
margin-top: 30px;
margin-left: 38px;
}
.offer p {
top: 45px;
font-size: 51px;
}
.offer a {
font-size: 20px;
padding: 15px 15px;
top: 271px;
right: 52px;
}
}
@media(min-width:576px) and (max-width:767px) {
.body img {
width: 160px;
margin-left: 25px;
}
.offer p {
font-size: 34px;
}
.offer a {
top: 200px;
font-size: 20px;
padding: 15px 15px;
}
}
@media(min-width:768px) and (max-width:991px) {
.body img {
width: 176px;
margin-top: 23px;
margin-left: 60px;
}
.offer p {
font-size: 47px;
}
.offer a {
top: 200px;
padding: 15px 15px;
font-size: 20px;
}
}
/*
@media(min-width:992px) and (max-width:1199px) {
.body img{
width: 180px;
margin-top: 17px;
margin-left: 53px;
}
.offer p {
font-size: 65px;
}
.offer a {
top: 235px;
padding: 15px 15px;
font-size: 20px;
}
}
*/
@media (min-width:1200px) {
.body img {
width: 180px;
margin-top: 17px;
}
.offer p {
font-size: 80px;
top: 100px;
}
.offer a {
top: 250px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Win Samsung Galaxy S10</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
</head>
<body>
<div class="body">
<img src="final-samsung-phone.png" alt="final-samsung-phone">
</div>
<div class="offer">
<p>Win Samsung Galaxy S10</p>
<a href="#">Claim Your Offer</a>
</div>
</body>
</html>
最佳答案
根据您的解析器,您可能需要像这样“ self ”关闭您的 meta
和 link
标签(注意 /
):
<meta charset="UTF-8" />
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" />
关于html - 尝试在博客上上传我自己编写的代码时如何修复 "Could not load theme preview: Error parsing XML,",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56173302/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!