gpt4 book ai didi

html - 站点范围的导航链接在一个页面上响应,但在另一个页面上没有响应?

转载 作者:行者123 更新时间:2023-11-28 15:21:57 24 4
gpt4 key购买 nike

我正在 Rails 上构建一个站点,并实现了一个站点范围的导航栏以显示在所有页面上。问题是它显示在两个页面上,但是链接和悬停状态只能在一个页面上点击?当我渲染相同的 _navigation.html.erb 和 nav.scss 文件时,我不知道出了什么问题?


_navigation.html.erb

<nav>
<div class="container nav-container">
<div class="row">
<div class="nav-wrapper">
<a href="#" id="brand-logo" class="col l2"><img src="<%= asset_path('social-playground-logo.png')%>"></a>
<ul id="nav-mobile" class=" col l10 right hide-on-med-and-down nav-desktop">
<li><a id="link-home" href="">Home</a></li>
<li><a id="link-toys" href="">Toys</a></li>
<li><a id="link-pastevents" href="">Past Events</a></li>
<li><a id="link-contacts" href="">Contacts</a></li>
<li><a id="link-partners" href="">Partners</a></li>
</ul>
</div>
</div>
</div>

gifpage.html.erb 导航栏和主图提取(正常工作)

<div class="hero-image-container group">
<%= render 'layouts/navigation' %>
<img id="gif-foreground-hero" src="<%= asset_path( 'GIF Foreground FInal.png') %>" class="responsive-img">

selfies.html.erb 导航栏和主图提取(不能正常工作)

<div class="selfies-hero-image-container group">
<%= render 'layouts/navigation' %>
<img id="selfie-foreground-hero" src="<%= asset_path( 'Selfie-hero-foreground.png') %>" class="responsive-img">

两者的_nav.scss

nav {
height: 112px;
line-height: 23px;
background: rgba(10, 10, 10, 0.5);

.nav-container {
width: 100%;

#brand-logo {
transform: scale(0.8);
margin-top: 7px;
margin-left: 4%;
}

#nav-mobile {
margin-right: 0%;
margin-left: 0%;
width: 79.33333%;
}

ul li {
margin-top: 27px;
margin-left: 29px;

a {
text-transform: uppercase;
border: 4px solid rgba(255, 255, 255, 0);
margin: 0px;
padding: 14px 25px;
display: inline-block;

&:hover {
border: 4px solid rgba(255, 255, 255, 1);
}
}
}
}

边框出现在 gif 页面的 :hover 上,但自拍不出现。

谢谢你们 Both hero images to appear beneath a 0.5 opacity navbar

The blue kero image is the page not working

两个英雄图像都通过导航栏显示,导航栏具有 0.5 的不透明度。

谢谢


编辑

终端打印输出

Started GET "/gifpage" for 59.167.19.225 at 2015-10-21 05:30:23 +0000
Cannot render console from 59.167.19.225! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by PagesController#gifpage as HTML
Rendered layouts/_navigation.html.erb (0.5ms)
Rendered pages/gifpage.html.erb within layouts/application (62.3ms)
Rendered layouts/_footer.html.erb (0.0ms)
Completed 200 OK in 445ms (Views: 444.1ms | ActiveRecord: 0.0ms)

与,

Started GET "/assets/_nav-87ab5873b40bcbbebe26b4faa985fc95.css?body=1" 

作为为正在工作的页面呈现的 _nav.scss 文件,并且,

Started GET "/" for 59.167.19.225 at 2015-10-21 05:34:25 +0000
Cannot render console from 59.167.19.225! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by PagesController#selfies as HTML
Rendered layouts/_navigation.html.erb (0.9ms)
Rendered pages/selfies.html.erb within layouts/application (8.0ms)
Rendered layouts/_footer.html.erb (0.0ms)
Completed 200 OK in 410ms (Views: 408.8ms | ActiveRecord: 0.0ms)

与,

Started GET "/assets/_nav-87ab5873b40bcbbebe26b4faa985fc95.css?body=1"

正在为无法正常工作的页面呈现。

我还在 chrome inspect element 中并排比较了 css 和 structure,两者完全相同。还是不知道!

最佳答案

看一下源码,看看asset pipeline渲染的是不是同一个.css文件;也许不同的 Controller 有不同的 css 文件。或者,inspect element 将向您显示为每个元素加载的 css。也许您还点击了 LVHA 的 css 排序(链接/访问/悬停/事件)。

关于html - 站点范围的导航链接在一个页面上响应,但在另一个页面上没有响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33251145/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com