- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好亲爱的开发者社区,我几天前开始编程。我开始为艺术家制作主页。
我有一个响应式菜单,当屏幕变小时,它会转换为带有按钮的下拉菜单。它还具有滚动效果。添加轮播(图像 slider )时:菜单栏变得困惑。我已经制作了屏幕截图,以明确问题:
问题 1
菜单栏移向右侧。它应该填满屏幕的顶部
问题2
当屏幕变小时,Bar 会向底部移动。
我希望有人可以帮助我解决这个问题。
这里的代码:
html, body {
margin: 0;
padding: 0;
width: 100%;
}
body {
font-family: "Helvetica Neue",sans-serif;
font-weight: lighter;
}
header {
width: 100%;
height: 100vh;
background-color: #111
background: url(bilder/acrylic/63.jpg) no-repeat 50% 50%;
background-size: cover;
}
.content {
width: 94%;
margin: 4em auto;
font-size: 20px;
line-height: 30px;
text-align: justify;
}
.logo {
line-height: 40px;
position: fixed;
float: left;
margin: 16px 46px;
color: #fff;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
height:40px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
}
nav ul {
line-height: 40px;
list-style: none;
background: rgba(0, 0, 0, 0);
overflow: hidden;
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black ul {
background: #111; opacity: 50%
}
nav ul li {
display: inline-block;
padding: 16px 40px;;
}
nav ul li a {
text-decoration: none;
color: #fff;
font-size: 16px;
text-transform: uppercase;
margin: 0 10px;
}
nav ul li a,
nav ul li a:after,
nav ul li a:before {
transition: all .5s;
}
nav ul li a:hover {
color: #555;
}
.menu-icon {
line-height: 40px;
width: 100%;
background: #111;
text-align: right;
box-sizing: border-box;
padding: 15px 24px;
cursor: pointer;
color: #fff;
display: none;
}
@media(max-width: 786px) {
.logo {
position: fixed;
top: 0;
margin-top: 16px;
}
nav ul {
max-height: 0px;
background: #111;
}
nav.black ul {
background: #111;
}
.showing {
max-height: 34em;
}
nav ul li {
box-sizing: border-box;
width: 100%;
padding: 24px;
text-align: center;
}
.menu-icon {
display: block;
}
}
nav.shift ul li a {
position:relative;
z-index: 1;
}
nav.shift ul li a:hover {
color: #777;
}
nav.shift ul li a:after {
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 1px;
content: '.';
color: transparent;
background: ;
visibility: none;
opacity: 0;
z-index: -1;
}
nav.shift ul li a:hover:after {
opacity: 1;
visibility: visible;
height: 100%;
}
.img {
min-height: 15%;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Viktoria Nagel</title>
<link rel="stylesheet" href="css.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
</head>
<body>
<!-- IMAGE SLIDER -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="item active">
<img src="https://imgur.com/J5AvznH" alt="First slide">
<div class="carousel-caption">
<h3>
Acrylic</h3>
<p>
Wildlife, Stillife</p>
</div>
</div>
<div class="item">
<img src="https://imgur.com/buAVgjt" alt="Second slide">
<div class="carousel-caption">
<h3>
Pencil</h3>
<p>
Portrait, Nude</p>
</div>
</div>
<div class="item">
<img src="https://imgur.com/IysG1mL" alt="Third slide">
<div class="carousel-caption">
<h3>
Pottery</h3>
<p>
Vases, Bowls</p>
</div>
</div>
</div>
</div>
<div class="main-text hidden-xs">
<div class="col-md-12 text-center">
<h1>
Viktoria Nagel</h1>
<h3>
Master of Fine Art</h3>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!--END SLIDER -->
<!--MENU-->
<div class="wrapper">
<header>
<nav class="shift">
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<div class="logo">
<img src="vnlogow.png" height="50px">
</div>
<div class="menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">About</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</nav>
</header>
<!-- End MENU-->
<div class="content">
<div container>
<div class="img">
<img src="bilder/acrylic/01.jpg"
width="20%"
style="float: left; padding: 25px 10px 1000px 0px"
>
</div>
<p>
Dear viewer,
My name is Viktoria Nagel.<br> I was born in Russia in 1969, although my roots go back to Germany.
<br>
My family and I have been working in the beautiful town of Lorch in southern Germany since 1996. This is where we have found our home and we lead happy lives here.
<br>
It was only after we settled down in Lorch that my painting hobby became my pure and all-consuming passion. After a few years of practice, accumulating experience through my own experimentation, I was ready to exhibit my artwork. I was overwhelmed by the positive response and demand for my work, which has since enabled me to transform my hobby into a career. I have been working as an independent and freelance artist with "VN-Arts" since 2010.
<br>
I am enthusiastic about sharing my knowledge and skill, so I also offer painting and pottery courses.
<br><br>
In my relatively short, full-time art career, I am grateful to have met with encouraging successes, for example:
<br><br>
<b>2009</b> Finalist "International Art Competition X-Power Gallery" Beverly Hills, USA
<br><br>
<b>2010</b> Finalist "International Art Competition X-Power Gallery" Taipei/Taiwan
<br><br>
<b>2010</b> First place at "Russian Art Week" Moscow (international Exhibition and Contemporary Art Competition)
<br><br>
<b>2011</b> Art and X-Power Gallery Exhibition in New York GP DEVA USA
<br><br>
<b>2011</b> Forth Open Art 2011. Artist from Europe in Baden-Baden.
<br><br>
My specialities include acrylic painting and the photorealistic rendering of people, nature and animals.
<br>
With every work my goal is to capture, on canvas, the beauty and emotion of my subject and, in the most beautiful way possible, to serve this to the viewer.
<br>
My wish is that you would thoroughly enjoy and have fun as you view my artworks, and I greatly look forward to your feedback.
<br>
Kind regards,
V. Nagel
</p>
</div>
</div>
</div>
<!---Script Menu-->
<script type="text/javascript">
// Menu-toggle button
$(document).ready(function() {
$(".menu-icon").on("click", function() {
$("nav ul").toggleClass("showing");
});
});
// Scrolling Effect
$(window).on("scroll", function() {
if($(window).scrollTop()) {
$('nav').addClass('black');
}
else {
$('nav').removeClass('black');
}
})
</script>
</body>
</html>
非常感谢!
你好,埃迪。
最佳答案
现在请看你的问题解决了。复制并粘贴到您的 html 页面
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Viktoria Nagel</title>
<link rel="stylesheet" href="css.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
}
body {
font-family: "Helvetica Neue",sans-serif;
font-weight: lighter;
}
header {
width: 100%;
height: 100vh;
background-color: #111
background: url(bilder/acrylic/63.jpg) no-repeat 50% 50%;
background-size: cover;
}
.content {
width: 94%;
margin: 4em auto;
font-size: 20px;
line-height: 30px;
text-align: justify;
}
.logo {
line-height: 40px;
position: fixed;
float: left;
margin: 16px 46px;
color: #fff;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
height:40px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
left: 0;
}
nav ul {
line-height: 40px;
list-style: none;
background: rgba(0, 0, 0, 0);
overflow: hidden;
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black ul {
background: #111; opacity: 50%
}
nav ul li {
display: inline-block;
padding: 16px 40px;;
}
nav ul li a {
text-decoration: none;
color: #fff;
font-size: 16px;
text-transform: uppercase;
margin: 0 10px;
}
nav ul li a,
nav ul li a:after,
nav ul li a:before {
transition: all .5s;
}
nav ul li a:hover {
color: #555;
}
.menu-icon {
line-height: 40px;
width: 100%;
background: #111;
text-align: right;
box-sizing: border-box;
padding: 15px 24px;
cursor: pointer;
color: #fff;
display: none;
}
@media(max-width: 786px) {
.logo {
position: fixed;
top: 0;
margin-top: 16px;
}
nav ul {
max-height: 0px;
background: #111;
}
nav.black ul {
background: #111;
}
.showing {
max-height: 34em;
}
nav ul li {
box-sizing: border-box;
width: 100%;
padding: 24px;
text-align: center;
}
.menu-icon {
display: block;
}
}
nav.shift ul li a {
position:relative;
z-index: 1;
}
nav.shift ul li a:hover {
color: #777;
}
nav.shift ul li a:after {
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
width: 100%;
height: 1px;
content: '.';
color: transparent;
background: ;
visibility: none;
opacity: 0;
z-index: -1;
}
nav.shift ul li a:hover:after {
opacity: 1;
visibility: visible;
height: 100%;
}
.img {
min-height: 15%;
}
</style>
</head>
<body>
<!-- IMAGE SLIDER -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="wrapper">
<header>
<nav class="shift">
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<div class="logo">
<img src="vnlogow.png" height="50px">
</div>
<div class="menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">About</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</nav>
</header>
<div class="content">
<div class="container">
<div class="img">
<img src="bilder/acrylic/01.jpg" width="20%" style="float: left; padding: 25px 10px 1000px 0px">
</div>
<p>
Dear viewer, My name is Viktoria Nagel.<br> I was born in Russia in 1969, although my roots go back to Germany.
<br> My family and I have been working in the beautiful town of Lorch in southern Germany since 1996. This is where we have found our home and we lead happy lives here.
<br> It was only after we settled down in Lorch that my painting hobby became my pure and all-consuming passion. After a few years of practice, accumulating experience through my own experimentation, I was ready to exhibit
my artwork. I was overwhelmed by the positive response and demand for my work, which has since enabled me to transform my hobby into a career. I have been working as an independent and freelance artist with "VN-Arts" since
2010.
<br> I am enthusiastic about sharing my knowledge and skill, so I also offer painting and pottery courses.
<br><br> In my relatively short, full-time art career, I am grateful to have met with encouraging successes, for example:
<br><br>
<b>2009</b> Finalist "International Art Competition X-Power Gallery" Beverly Hills, USA
<br><br>
<b>2010</b> Finalist "International Art Competition X-Power Gallery" Taipei/Taiwan
<br><br>
<b>2010</b> First place at "Russian Art Week" Moscow (international Exhibition and Contemporary Art Competition)
<br><br>
<b>2011</b> Art and X-Power Gallery Exhibition in New York GP DEVA USA
<br><br>
<b>2011</b> Forth Open Art 2011. Artist from Europe in Baden-Baden.
<br><br> My specialities include acrylic painting and the photorealistic rendering of people, nature and animals.
<br> With every work my goal is to capture, on canvas, the beauty and emotion of my subject and, in the most beautiful way possible, to serve this to the viewer.
<br> My wish is that you would thoroughly enjoy and have fun as you view my artworks, and I greatly look forward to your feedback.
<br> Kind regards, V. Nagel
</p>
<div class="col-md-12">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="item active">
<img src="http://via.placeholder.com/1000x350" alt="First slide">
<div class="carousel-caption">
<h3>
Acrylic</h3>
<p>
Wildlife, Stillife</p>
</div>
</div>
<div class="item">
<img src="http://via.placeholder.com/1000x350" alt="Second slide">
<div class="carousel-caption">
<h3>
Pencil</h3>
<p>
Portrait, Nude</p>
</div>
</div>
<div class="item">
<img src="http://via.placeholder.com/1000x350" alt="Third slide">
<div class="carousel-caption">
<h3>
Pottery</h3>
<p>
Vases, Bowls</p>
</div>
</div>
</div>
</div>
<div class="main-text hidden-xs">
<div class="col-md-12 text-center">
<h1>
Viktoria Nagel</h1>
<h3>
Master of Fine Art</h3>
</div>
</div>
</div>
</div>
</div>
</div>
<!---Script Menu-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript">
// Menu-toggle button
$(document).ready(function() {
$(".menu-icon").on("click", function() {
$("nav ul").toggleClass("showing");
});
});
// Scrolling Effect
$(window).on("scroll", function() {
if($(window).scrollTop()) {
$('nav').addClass('black');
}
else {
$('nav').removeClass('black');
}
})
</script>
</body>
</html>
关于javascript - 轮播(图像 slider )与响应式菜单冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49468992/
我的工作是将每条记录写入 Hadoop 映射中的 DynamoDB。 我无法使用具有 httpclient-4.2.5.jar 和 httpcore-4.2.5.jar 的 Hadoop 2.6 运行
我在 JavaScript 中嵌套了循环开关,例如: for (var i = 0; i < checkBoxIds.length; i++) { if ($('#' + checkB
我有一个文件夹被重命名的分支。现在我正在尝试合并从主干到这个分支的更改,但是在主干中修改的文件仍然在原始文件夹名称下,因此 svn 引发了树冲突。我该如何解决这个问题? 该文件夹已使用 svn ren
我在使用 jquery 暴露插件和 Masked 输入插件时遇到了问题。问题是它们都占用 $.mask 函数,从而导致冲突。但我非常需要这两个插件一起工作。我会将其中一个中的 $.mask 重命名为.
我正在尝试为我所有的 INPUT 元素做一个简单的 :focus 效果,就像这样: INPUT:focus { border-color: orange; } 这很好用,直到我将这段 CSS 添加到样
我是 javascript 的新手。 在 wordpress 上工作,我在自定义 js 中为我的主题输入了以下函数: document.getElementsByName("empty_cart")[
为什么有些 javascript 会与其他的发生冲突?我的意思是我一直在为图片库使用 javascript 代码,然后尝试在 jquery 中获取文本水印。为什么在使用 jquery 之后,画廊完全消
是否可以根据已知的输入值创建 MD5 碰撞? 所以例如我有输入字符串 abc与 MD5 900150983cd24fb0d6963f7d28e17f72 . 现在我想将字节添加到字符串 def获得相同
我在我的项目中使用原型(prototype): NodeParser.prototype.getChildren = function(parentContainer) { return fl
根据我对 merge 冲突的理解,当两个人更改了同一文件和/或修改了该文件中的同一行时,就会发生 merge 冲突。所以当我做一个 git pull origin master 我期望 merge 冲
iPad 上 Mobile Safari 中的 HTML5 模板。带 iScroll 的 Div 工作正常。 if/else 语句中还包含一个 jQuery 函数。该函数测试用户是否在 iScroll
我一直在尝试使 2 个脚本(1 个 mootol 和 1 个 jquery)在同一页面上工作,但没有成功。我一直在研究许多论坛等,但我仍然无法使这两个脚本同时工作。 这就是它在我的标题中的样子: /w
我想克隆带标题的问号。一切正常,但是当我将鼠标悬停在新问号上时,第一个问号上会出现工具提示。有什么想法吗? 我正在使用 jQuery 和醉酒的工具提示。 Demo here click here
好吧,我已经在一个 friend 的网站上工作了一段时间了。我的编码技能......值得怀疑,而且我遇到了很多问题。 目前我网站上的 jQuery 停止工作了,我找不到原因,并且我已尽一切努力让它工作
我想使用一个文件来保存所有#define 和常量:示例 #ifndef CONSTANTS_H_ #define CONSTANTS_H_ #include //OVERALL DEFS
我在我的表单中的所有 HTML 下都有一些验证码,这似乎阻止了我的复选框验证码的工作,一旦我在我的 HTML 下的代码周围添加/* */(使其不活动),我就得出了这个结论) 复选框验证代码开始正常工作
我是新手。我的页面上有两个 javascript/jquery。如果我使用第一个脚本,第二个脚本将不起作用。如果我删除第一个脚本,第二个脚本就可以正常工作。我不知道如何解决这个问题。我知道有一个“无冲
我是 Bison 新手,在处理 Shift/Reduce 冲突时遇到了麻烦... 我正在为C语言编写语法规则:ID是标识变量的标记,我编写此规则是为了确保即使将标识符写在括号中,也可以考虑它。 id
我目前正在使用 LibGdx 开发我的第一个 Android 游戏项目。这是一款 2D 迷宫游戏,您可以使用触摸输入从其中一个入口到其中一个导出“画出”一条线。世界本身是一个 TiledMap,目前仅
我正在尝试通过 javascript 完成表单验证,并在 #form# 标记中放置一个要执行的 .py 文件操作。但问题是,当我提交数据后,它不会重定向到 .py 操作。所以我摆脱了 preventd
我是一名优秀的程序员,十分优秀!