- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
它是如此基础,但我似乎无法正确使用。导航栏位于导航栏下方之后的正文部分。此外,当出现警告消息(例如错误的凭据)时,它会位于导航栏下方,因此无法阅读。我究竟做错了什么? (我正在使用 Rails 3.2 和 Ruby 4)。
在 application.html.erb 我有:
<%= render "layouts/header" %>
<% flash.each do |name,msg| %>
<p class="alert"><%= content_tag :div, msg, :id => name %></p>
<% end %>
<p class="notice"><%= notice %></p>
<%= yield %>
<%= render "layouts/footer" %>
呈现的部分 html 代码:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
...etc...
</div><!--/.nav-collapse -->
</div>
</nav>
<p class="notice"></p>
<h2>Log in</h2>
<form accept-charset="UTF-8" action="/users/sign_in" class="new_user" id="new_user" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="GRy...00Z1w=" /></div>
<div class="field">
<label for="user_email">Email</label><br />
...etc...
关于 CSS,我使用 bootstrap 除了:
-导航的CSS:
.nav a {
color: #5a5a5a;
font-size: 11px;
font-weight: bold;
padding: 14px 10px;
text-transform: uppercase;
}
.nav li {
display: inline;
}
.loginnaam {
font-size: 11px;
padding: 16px 10px;
}
-文本的CSS:
/* JUMBOTRON ON HOME
================================================== */
.jumbotron {
background-image: url('http://www.....com/....jpg');
height: 500px;
background-repeat: no-repeat;
background-size: cover;
}
.jumbotron h1 {
color: #fff;
font-size: 48px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.jumbotron p {
font-size: 20px;
color: #fff;
}
/* CUSTOMIZE THE CAROUSEL
================================================== */
/* Carousel base class */
.carousel {
height: 500px;
margin-bottom: 60px;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
z-index: 10;
}
/* Declare heights because of positioning of img element */
.carousel .item {
height: 500px;
background-color: #777;
}
.carousel-inner > .item > img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: 500px;
}
/* ILLUSTRATIES
================================================== */
.illustraties{
background-color: #efefef;
border-bottom: 1px solid #dbdbdb;
}
.learn-more {
background-color: #f7f7f7;
}
.learn-more h3 {
font-family: 'Shift', sans-serif;
font-size: 18px;
font-weight: bold;
}
.learn-more a {
color: #00b0ff;
}
最佳答案
您的导航栏是固定的,这意味着它位于所有内容之上,除了具有更高 z - 索引且具有绝对或固定位置的内容。
只要在你的 body 上添加一个 margin-top,就像导航栏的高度一样。然后,您所有的内容都应位于导航栏下方。
关于HTML 定位 : overlap between navigation bar and text,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28250261/
我是 React Native 的新手,目前正在研究 React Native Navigation Docs 。我想知道:navigation.push() 和 navigation.navigat
来自 this和 this , 我了解到 navigation.navigate() 之间存在有意义的差异和 navigation.push() .尽管如此,我仍然想知道我是否可以使用 navigat
我正在使用 react-navigation 3.6.1 和 react-native-camera 2.2.2。当我拍照时,进入下一个屏幕的按钮在第一次按下时没有任何作用。必须按多次 这是针对 io
androidx.navigation:navigation-ui 和 android.arch.navigation:navigation-ui-ktx 有什么区别? 当我在我的 gradle 中使
使用 TypeScript 时,react-navigation 中发生的一个常见错误是: Argument of type 'string' is not assignable to paramet
我有一个使用 React Native 的应用程序,我正在使用 react-navigation (5.2.9)。 我构建了一个 Stack.Navigator,我有我的屏幕,但我希望页脚组件在外面,
我有一个组件在 NavigationContainer 组件内但在 Stack Navigator 之外。我能知道组件中的当前路由是什么吗?我不能使用 useRoute Hook ,因为它出错了: C
关闭。这个问题需要更多 focused .它目前不接受答案。 想改进这个问题?更新问题,使其仅关注一个问题 editing this post . 3年前关闭。 Improve this questi
我正在学习 react-native 导航 https://reactnavigation.org/docs/intro/ 。我在那里的例子中看到 class HomeScreen extends R
我在我的 native 项目中使用 eslint airbnb。如果我没有验证 Prop ,特别是来自 react-navigation 的 Prop ,eslint 会抛出错误 linting .
在我的应用程序中,我有 6 个不同的页面。 有 1 个页面称为“收藏夹页面”,其中列出了用户选择的收藏夹。它们由一列显示,该列使用来自另一个类的列表。列表代码如下: List favoriteCo
我在 react 导航问题部分看到很多人使用 this.props.navigation.dispatch 以编程方式导航。是否有任何特定原因或用例需要在 this.props.navigation.
我在 vue.js 中开始了一个新元素。我添加了导航栏。有一次,我注意到控制台中有问题: Audit usage of navigator.userAgent, navigator.appVersio
首先,是的,我知道有很多与此问题相关的答案,但我发现了这种在 react-native 0.60 中进行导航的特定方法,问题是,我还没有弄清楚,而且我不想刮掉这个导航方法来测试不同的方法,这是导航文件
react 导航 5 我在 TabNavigator 内部构建了一个 StackNavigator,并且主屏幕和其他屏幕之间的导航正在工作。但问题是,当我从 Tab2 移动到 Tab1 时,我希望 T
我正在尝试在 react-native with expo 中使用 react-navigation-redux-helpers 将 redux 与 react-navigation 集成。但是,尽管
我正在尝试使用最新的 react-navigation 版本运行我的应用程序但无法正常工作。也尝试使用此解决方案 ( Invariant Violation: The navigation prop
我正在尝试使用 React Navigation 和 StackNavigator 在我的应用中导航。 我有一个带有 onPress={() => navigate('DetailsScreen'
我在我的应用程序中使用 react 导航。如果我从 screen A 导航到 Screen B,如果转换完成,我如何获得一些反馈。 最佳答案 从 'react-native 导入 { Interact
我遵循的是身份验证流程 (https://reactnavigation.org/docs/en/auth-flow.html) 上的 React 导航指南,但略有不同。我在 LoginScreen
我是一名优秀的程序员,十分优秀!