- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
#titleBar p {
font-family: "Arial";
font-size: 3em;
float: left;
width: 100%;
display: inline-block;
margin: 0;
padding-left:10px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
width: auto;
display: inline-block;
float: right;
margin-top: -40px;
}
li {
display: inline;
}
li a {
display: inline;
margin-right: 46px;
color: black;
font-family: "Arial";
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #ffffff;
}
.active {
background-color: #99ff6;
}
* {
padding: 0;
margin: 0
}
body {
background-color: #000000;
}
.crossfade > figure {
animation: imageAnimation 30s linear infinite 0s;
backface-visibility: hidden;
background-size: cover;
background-position: center center;
color: transparent;
height: 100%;
left: 0px;
opacity: 0;
position: absolute;
top: 0px;
width: 100%;
z-index: 0;
}
.crossfade > figure:nth-child(1) {
background-image: url('tokyo.jpg');
}
.crossfade > figure:nth-child(2) {
animation-delay: 6s;
background-image: url('osaka.jpg');
}
.crossfade > figure:nth-child(3) {
animation-delay: 12s;
background-image: url('dubai.jpg');
}
.crossfade > figure:nth-child(4) {
animation-delay: 18s;
background-image: url('rome.jpg');
}
.crossfade > figure:nth-child(5) {
animation-delay: 24s;
background-image: url('paris.jpg');
}
.crossfade > figure:nth-child(6) {
animation-delay: 30s;
background-image: url('singapore.jpg');
}
.crossfade > figure:nth-child(7) {
animation-delay: 36s;
background-image: url('istanbul.jpg');
}
@keyframes imageAnimation {
0% {
animation-timing-function: ease-in;
opacity: 0;
}
8% {
animation-timing-function: ease-out;
opacity: 1;
}
17% {
opacity: 1
}
25% {
opacity: 0
}
100% {
opacity: 0
}
}
<html>
<head>
<title>My Travels</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="An image crossfade animation done with CSS3">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="titleBar" style>
<img src="travel.png" style="padding-top: 20px; padding-left: 60; padding-bottom: 15; height: 50; a href="Travel.html"">
</div>
<div class="crossfade">
<figure></figure>
<figure></figure>
<figure></figure>
<figure></figure>
<figure></figure>
</div>
</body>
</html>
最佳答案
只需使用 z-index将您的 Logo 移动到顶部,将图形移动到底部,如下所示:
#titleBar p {
font-family: "Arial";
font-size: 3em;
float: left;
width: 100%;
display: inline-block;
margin: 0;
padding-left: 10px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
width: auto;
display: inline-block;
float: right;
margin-top: -40px;
}
li {
display: inline;
}
li a {
display: inline;
margin-right: 46px;
color: black;
font-family: "Arial";
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #ffffff;
}
.crossfade > figure {
animation: imageAnimation 30s linear infinite 0s;
backface-visibility: hidden;
background-size: cover;
background-position: center center;
color: transparent;
height: 100%;
left: 0px;
opacity: 0;
position: absolute;
top: 0px;
width: 100%;
z-index: -1;
}
.crossfade > figure:nth-child(1) {
background-image: url('https://pbs.twimg.com/profile_images/434258933721489409/Hg0Z1blu.jpeg');
}
.crossfade > figure:nth-child(2) {
animation-delay: 6s;
background-image: url('http://www.drodd.com/images15/2-22.png');
}
.crossfade > figure:nth-child(3) {
animation-delay: 12s;
background-image: url('http://www.freeiconspng.com/uploads/number-3-icon-17.png');
}
.crossfade > figure:nth-child(4) {
animation-delay: 18s;
background-image: url('https://pbs.twimg.com/profile_images/708068901620486144/QO17QaY-.jpg');
}
.crossfade > figure:nth-child(5) {
animation-delay: 24s;
background-image: url('http://www.kidsmathgamesonline.com/images/pictures/numbers600/number5.jpg');
}
.crossfade > figure:nth-child(6) {
animation-delay: 30s;
background-image: url('https://pbs.twimg.com/profile_images/863084976476233729/iKoEcmWt.jpg');
}
.crossfade > figure:nth-child(7) {
animation-delay: 36s;
background-image: url('https://pbs.twimg.com/profile_images/613986789586542592/vDhMOvlR.jpg');
}
@keyframes imageAnimation {
0% {
animation-timing-function: ease-in;
opacity: 0;
}
8% {
animation-timing-function: ease-out;
opacity: 1;
}
17% {
opacity: 1
}
25% {
opacity: 0
}
100% {
opacity: 0
}
}
<div id="titleBar" style>
<a href="Travel.html"><img src="https://www.viva64.com/media/images/content/b/0482_PVS-Studio_Free_StackOverflow/image1_thm_blank_512x512.png" style="z-index: 20; padding-top: 20px; padding-left: 60; padding-bottom: 15; height: 50;" /></a>
</div>
<div class="crossfade">
<figure></figure>
<figure></figure>
<figure></figure>
<figure></figure>
<figure></figure>
</div>
关于html - 我用 html 编写了一个自动背景幻灯片,但我网站上的 Logo 不断淡入图像,就好像它是幻灯片的一部分一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44872158/
我制作了一个 jquery 幻灯片,代码如下: HTML previous Next CSS #slideshow { width: 700px; h
我正在用 Javascript 制作幻灯片,带有播放/暂停和下一个/上一个按钮。我已经设法使用播放/暂停按钮进行幻灯片放映,但现在我想向其中添加“下一个”和“上一个”按钮。有人可以帮我吗?我该怎么做?
我是 Java 脚本新手,我正在尝试为我的页面构建幻灯片。这是我的 html 代码: 和我的 Js 脚本: var numar_ima
我可以修改此现有代码以自动滚动列表项以显示内容吗? 抱歉,:ul li a {} 链接。 也许使用“间隔”方法? $(document).ready(function(){ $('ul.tab
我正在尝试熟悉 jQuery 工具 - Flowplayer 中的幻灯片 ( http://flowplayer.org/tools/tabs/slideshow.html )。有没有人提示我如何选择
这个问题在这里已经有了答案: Return to 1st image on slideshow (2 个答案) 关闭 3 年前。 有谁知道如何在此幻灯片中添加另一个按钮,使用户在幻灯片放映期间的任何
我知道这听起来很傻,我可以使用一些现成的解决方案,但我真的很想构建自己的简单图像幻灯片。我在 Silverlight/WPF 中进行应用程序开发已经有一段时间了,但无论出于何种原因,我都无法解决这个问
我正在尝试设置此幻灯片脚本,以便显示的第一张图片是随机的(每次我们访问该网站时,我都需要第一张图片是不同/随机的幻灯片),其余图片可以显示在正确的顺序,没关系。 我正在使用 Jon Raasch 的简
我们的 flexslider 上最后一张图片的一小部分在幻灯片加载后立即闪烁整个页面。第一个图像设置为可见,所有其他图像设置为隐藏。插件设置为在页面加载后运行。我认为可能是页面上的其他原因导致了此问题
我有一个自动幻灯片放映效果很好。但是,我希望能够改变某些幻灯片的速度这是代码: var slideIndex = 0; showSlides(); function showSlides() {
如有任何帮助,我们将不胜感激! 我正在尝试从以下位置实现脚本: www.switchonthecode.com/tutorials/jquery-creating-a-slideshow 但我希望它连
我用 javascript 创建了以下幻灯片。但是由于某种原因,在第一张图片滑过时,第一张图片刚好移开,而第二张图片进行了“滑动”。任何帮助,将不胜感激。我添加了注释以帮助提高代码的可读性。
我正在使用在以下网站在线找到的带缩略图的图像幻灯片。有谁知道我将如何更改此幻灯片,以便将缩略图列在幻灯片的右侧,而不是列在其下方。如果您转到下面的链接,然后单击查看演示,您可以看到我的幻灯片目前是如何
我希望在悬停链接时有过渡效果。我希望在链接后顺利显示文本。 这就是我目前所拥有的: p { border-radius: 1em; padding: 0.5em; backgr
我喜欢jQuery的幻灯片效果,当你move a cursor on some of products 我正在尝试使用类似的功能实现相同的效果,但有一个区别 - 当我在框上移动光标时,我想显示带有信息
我正在尝试创建自己的幻灯片。以下代码从一张图像淡入另一张图像。我想从 img1.jpg 循环到 img4.jpg,但我不确定如何在每次更改后暂停。 i++;
jquery 中的代码是什么,可以让幻灯片放映在最后一张照片上单击“下一步”后显示第一张照片。我知道我只需要写一次文档准备好,但我还没有这样做,但我会的。这是我的代码
如何添加指向这些图像的链接。我尝试过多种幻灯片放映方式,但发现当我添加链接时,它开始不显示所有其他图像。在我下面的代码中,我将链接注释掉了。如果我删除链接,图像显示正常。 我已经重复了两次图像只是为了
我似乎无法制作完全可用的 CSS 幻灯片,其中幻灯片的显示时间各不相同。我需要使用多个关键帧还是有其他方法可以做到这一点?如果是,将不胜感激 :^) 最佳答案 您可以使用单个关键帧设置和 CSS3 的
我用 HTML/CSS/JS 制作了这个小幻灯片。 大部分都在工作,但有一件事我想不通。 当自动滑动打开时,如何使每个图像上方的文本适合 img 本身? 现在它只在我手动点击时显示每个 img 的正确
我是一名优秀的程序员,十分优秀!