【发布时间】:2013-11-16 03:20:02
【问题描述】:
我想做类似于http://www.thomaspomarelle.com/ 的东西(当然是定制设计),但我遇到的问题是我的 about 部分应该在背景图片下方并通过滚动页面访问,继续标题顶部:(而且我绝对不知道为什么。我在想那是因为我在正文中有图像,但我尝试将图像放在标题部分之后的 div 中,但它不起作用一点也不。 这是我的代码:
<html>
<head>
<title>yudasinal</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" media="screen">
<link rel="stylesheet" type="text/css" href="custom.css">
</head>
<body id="backimage">
<nav class="navbar-wrapper navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">LOGO</a>
</div>
<div id = "projects">
<ul>
<li class = "line">
<a href = "#">HOME</a>
</li>
<li class = "line">
<a href = "#">HOME</a>
</li>
<li class = "line">
<a href = "#">HOME</a>
</li>
</ul>
</nav>
<script src="//code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
这是它的css:
#projects ul {
text-align: right;
margin-right: 10px;
padding: 15px 15px;
font-size: 18px;
line-height: 60px;
}
#projects li {
display: inline-block;
height: 40px;
position: relative;
overflow: hidden;
background-position: top center;
}
#projects ul li.line a {
padding: 0 30px 30px;
text-align: center;
}
#projects li.line a::after {
position: absolute;
top: 87%;
left: 0;
width: 100%;
height: 3px;
background: black;
content: '';
opacity: 0;
-webkit-transition: height 0.3s, opacity 0.3s, -webkit-transform 0.3s;
-moz-transition: height 0.3s, opacity 0.3s, -moz-transform 0.3s;
transition: height 0.3s, opacity 0.3s, transform 0.3s;
-webkit-transform: translateY(-10px);
-moz-transform: translateY(-10px);
transform: translateY(-10px);
}
#projects li.line a:hover::after,
#projects li.line a:focus::after {
height: 5px;
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
transform: translateY(0px);
}
#backimage {
background-image: url(http://cs425729.vk.me/v425729136/4e67/6abwVXLTK9s.jpg);
background-repeat: no-repeat;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: auto;
}
.wrapper {
width: 1000px;
margin: auto;
clear: both;
z-index: 10;
}
它也有 twitter 引导 css。
非常感谢提前帮助!!!
【问题讨论】:
-
什么是“关于部分”和什么是“标题部分”?我只能在正文中看到
nav元素。并且有许多未闭合的标签使 DOM 变得一团糟。你应该换一个新的编辑器。
标签: html css twitter-bootstrap background background-image