- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个导航栏,我有一些文本直接位于图像前面导航栏上方的正下方。此图像是响应式的,因此它会根据屏幕的大小进行缩放。但是,当我将屏幕调整到最小尺寸(即它在移动设备上的尺寸)时,图像会停留在一个地方,但通常固定在图像前面的文本会向上推,在导航栏后面。你能帮忙解释一下这是为什么吗?这是我的代码。
HTML
<header>
<!--Navigation Secton-->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"> Anna's Portfolio</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#"> About</a></li>
<li><a href="#">Works</a></li>
<li><a href="#">Talk To Me</a></li>
</ul>
</div>
</nav>
</header>
<body>
<!-- Top Image, Title Text-->
<div class="container-fluid">
<div class="row">
<img class="image img img-responsive" src="http://www.qerja.com/journal/wp-content/uploads/CODING.jpg">
<div class="text">
<h1>Anna's Portfolio</h1>
<h2>Come Inside.</h2>
</div>
</div>
</div>
<!--About, Mission-->
<div class="container-fluid">
<div class="row">
<div class="about">
<h2>About Me</h2>
<p>My name is Anna Gibson and I'm a web developer<br> who seeks to tell the stories of the marginalized.<br> I'm a staunch advocate for those who struggle with<br> their mental health and I hope that I can create apps<br> that will help people with their mental health as apps<br> have helped me. </p>
</div>
</div>
</div>
</body>
<footer></footer>
</html>
CSS
.navbar-brand {
position:relative;
bottom:70px;
text-align:right;
}
.image {
position:relative;
width:100%;
padding-top:0;
height:200px;
}
.text {
text-align:center;
position:relative;
bottom:400px;
color:white;
font-family:;
font-size:24px;
}
非常感谢,如果有任何不清楚的地方,请告诉我。
最佳答案
由于 bottom:400px,文本推到导航栏后面; .text
类的问题
您需要一些 HTML 和 CSS 修复
HTML
<header>
<!--Navigation Secton-->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Anna Portfolio</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#"> About</a></li>
<li><a href="#">Works</a></li>
<li><a href="#">Talk To Me</a></li>
</ul>
</div>
</div>
</nav>
</header>
<body>
<!-- Top Image, Title Text-->
<div class="container-fluid">
<div class="row">
<div class="main-section">
<img class="image img img-responsive" src="http://www.qerja.com/journal/wp-content/uploads/CODING.jpg">
<div class="text">
<h1>Anna's Portfolio</h1>
<h2>Come Inside.</h2>
</div>
</div>
</div>
</div>
<!--About, Mission-->
<div class="container-fluid">
<div class="row">
<div class="about">
<h2>About Me</h2>
<p>My name is Anna Gibson and I'm a web developer<br> who seeks to tell the stories of the marginalized.<br> I'm a staunch advocate for those who struggle with<br> their mental health and I hope that I can create apps<br> that will help people with their mental health as apps<br> have helped me. </p>
</div>
</div>
</div>
</body>
CSS
.navbar-brand {
position:relative;
bottom:70px;
text-align:right;
}
.main-section{
position: relative;
}
.image {
position:relative;
width:100%;
padding-top:0;
height:200px;
}
.text {
text-align:center;
position:absolute;
color:white;
font-family:;
font-size:24px;
left:0;
right:0;
top: 0;
bottom: 0;
margin:auto;
}
希望这有帮助..
关于css - 标题不断移入导航栏(Bootstrap),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45157024/
我目前正在开发一款炸弹人游戏 :D。老实说,它进行得非常好。我现在正在创建我的 map 编辑器,但我想知道是否可以使用输出流在 .txt 文件中移动?我已经学会了如何使用缓冲区(字符串)读取 whil
基本上,标题...如果没有 QThread(或者它只是被评论)我得到以下结果: LOG> Log working! LOG> PRODUCER: sent resource address: 2998
我有 3 个 View ,并希望将它们集成到一个 View 中,以便它们成为这一 View 中的子文件夹。 我怎样才能做到这一点?还是我必须制作一个 View ,然后再次手动添加和配置这些 View
void rotate( unsigned long mask[], int rotateCnt ); 此函数将当前 64 位掩码 (mask[]) 旋转 rotateCnt 位。如果rotateCn
这是一个非常高级的架构问题。为什么还没有将 JVM 移入linux 内核,它可以更高效(包括即时编译代码)。 我知道这对最小内核的粉丝来说是可恶的,但 Linux 不是那些操作系统之一,它似乎。可以通
我的 Internet 连接速度很慢,我试图避免下载以前的 XCode 文档集和 SDK。 我刚刚安装了 XCode 4.5,发现它们没有包含任何 iOS 版本的文档集。也只有适用于 iOS 6 的
当单击另一个 div 时,如何将一个 div(应该在最右侧的 View 之外)移动到页面上?在下面的代码笔中,我希望绿色 div (id = "three") 离开页面,当单击红色 div (id =
当将 std::unique_ptr 移动到 lambda 中时,无法在其上调用 reset(),因为它似乎是 const : error C2662: void std::unique_ptr>::
我正在将数据库转储到 SQL 转储中: docker exec mysql sh -c 'exec mysqldump --all-databases -uroot -ppassword' > all
我是一名优秀的程序员,十分优秀!