【发布时间】:2017-09-07 06:16:25
【问题描述】:
我在使用 bootstrap 和 css3 时遇到了一点问题。这是我的代码:
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Portfolio</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript"></script>
<style type="text/css">
body {
background: linear-gradient(132deg, #ec5218, #1665c1);
background-size: 400% 400%;
animation: BackgroundGradient 30s ease infinite;
}
@keyframes BackgroundGradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
h1 {
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
font-family: Open Sans, sans-serif;
color: #fff;
font-weight: 400;
text-transform: uppercase;
text-align: center;
font-size: 2em;
background-color: #000;
padding: 5px;
}
</style>
</head>
<body>
<h1>Mitchell Smith</h1>
<div class="container"></div>
</body>
</html>
现在的问题是,使用这段代码一切正常,我的身体有渐变背景,一切正常。现在,当我使用
链接引导程序时<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
我所有的 CSS 都消失了。有人可以帮我解决这个问题吗?
【问题讨论】:
-
小提琴会很好。
-
在你的 css 之前链接 bootstrap,
<link ..bootstrap/> <link ..you-css-file/>,这样你的样式就会覆盖 bootstrap's'。 -
复制并粘贴他的代码....
-
您可能会在您的之后包含引导库。尝试在最后包含您的代码。如果不是这种情况,请尝试在某处展示您的工作。
-
@MrGeek 尝试在我的 css 和我的 h1 样式工作之前链接引导程序,但渐变仍然没有出现。但是,如果我不链接引导程序,动画渐变效果会非常好。
标签: jquery html twitter-bootstrap css