我修改了主页标题。但是,我不希望除主页之外的所有其他网页看起来都像主页标题 View 。有没有办法删除 How can we help today?
和搜索栏标题 View ,并在主页以外的每个页面中简单地描绘标题?
Header look in every other web page than the homepage
/***** Header *****/
.header {
max-width: 1160px;
margin: 0 auto;
padding: 0 5%;
position: relative;
align-items: center;
display: flex;
height: 71px;
justify-content: space-between;
}
@media (min-width: 1160px) {
.header {
padding: 0;
width: 90%;
}
}
.logo img {
max-height: 37px;
}
.user-nav {
display: inline-block;
position: absolute;
white-space: nowrap;
}
<section class="section hero">
<header class="header">
<div class="logo">
{{#link 'help_center'}}
<img src="{{logo_url}}" alt="{{t 'logo'}}">
{{/link}}
</div>
<div class="nav-wrapper">
<span class="icon-menu"></span>
<nav class="user-nav" id="user-nav">
{{link 'new_request' class='submit-a-request'}}
</nav>
{{user_info}}
</div>
</header>
<div class="hero-inner">
<h1 style="color:white;">How can we help today?</h1>
{{search submit=false instant=true class='search search-full'}}
</div>
</section>
最佳答案
你能在主页上添加一个类吗?大多数 CMS 都有一个应用于 html 或 body 标签的“is-front”类。所以在css中,你可以做
.header-inner {display:none}
.is-front header-inner {display:block}
关于javascript - 删除除主页以外所有页面的公共(public)页眉中的特定元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54484175/