- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
关于 my website ,我的页眉和菜单之间显示了 80 像素的边距。这在首页上不是问题,只是在使用标准网站标题的博客上。
当我用谷歌检查它时,它说这是 div 上带有类自定义 header 的元素样式,而不是 CSS 的一部分。我正在使用 WordPress Twenty Sevente 的子主题。我查看了 CSS,但没有看到它说要添加边距的地方。我查看了 header-image.php 并没有找到任何东西。请注意,标题图片下方的边距在移动 View 中消失了。这是我在 child 和二十七岁时对 CSS/HTML 的了解:
子主题 CSS:
/* Front Page: Header */
.has-header-image .custom-header-media img,
.has-header-video .custom-header-media video,
.has-header-video .custom-header-media iframe {
position: absolute;
height: auto;
left: 50%;
max-width: 1000%;
min-height: 100%;
min-width: 100%;
min-width: 100vw; /* vw prevents 1px gap on left that 100% has */
width: auto;
top: 50%;
padding-bottom: 1px; /* Prevent header from extending beyond the footer */
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.has-header-image.twentyseventeen-front-page .site-branding,
.has-header-video.twentyseventeen-front-page .site-branding,
.has-header-image.home.blog .site-branding,
.has-header-video.home.sblog .site-branding {
display: table-cell;
vertical-align: top;
}
.has-header-image.twentyseventeen-front-page .site-branding,
.has-header-video.twentyseventeen-front-page .site-branding,
.has-header-image.home.blog .site-branding,
.has-header-video.home.blog .site-branding {
top: 40px;
display: block;
left: 0;
height: auto;
padding-top: 0;
position: absolute;
width: 100%;
}
body.has-header-image .site-title,
body.has-header-video .site-title,
body.has-header-image .site-title a,
body.has-header-video .site-title a {
color: #0F0566;
}
body.has-header-image .site-description,
body.has-header-video .site-description {
color: #2EE6D5;
opacity: 0.8;
font-size: 2rem;
}
.site-title {
font-family: Lato;
color: #0F0566;
font-size: 1.5rem;
text-transform: none;
}
.site-description {
font-family: Lato;
color: #0F0566;
position: absolute;
top: 70vh;
display: block;
left: 50vw;
height: auto;
padding-top: 0;
}
/* Scroll down arrow */
.site-header .menu-scroll-down {
display: block;
padding: 1em;
position: absolute;
right: 0;
margin: auto;
}
.site-header .menu-scroll-down .icon {
-webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */
-ms-transform: rotate(90deg); /* IE 9 */
transform: rotate(90deg);
}
.site-header .menu-scroll-down {
color: #fff;
top: 1em;
}
.site-header .navigation-top .menu-scroll-down {
color: #767676;
top: 0.7em;
}
.menu-scroll-down:focus {
outline: thin dotted;
}
.menu-scroll-down .icon {
height: 50px;
width: 40px;
}
/* Blog Header */
body.has-header-image:not(.twentyseventeen-front-page):not(.home) .site-title,
body.has-header-video:not(.twentyseventeen-front-page):not(.home) .site-title,
body.has-header-image:not(.twentyseventeen-front-page):not(.home) .site-title a,
body.has-header-video:not(.twentyseventeen-front-page):not(.home) .site-title a {
color: #2EE6D5;
}
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header {
margin-bottom: 0px;
}
.has-header-image:not(.twentyseventeen-front-page):not(.home) .site-description {
display: none;
}
二十十七个 CSS:
/*--------------------------------------------------------------
13.1 Header
--------------------------------------------------------------*/
#masthead .wrap {
position: relative;
}
.site-header {
background-color: #fafafa;
position: relative;
}
/* Site branding */
.site-branding {
padding: 1em 0;
position: relative;
-webkit-transition: margin-bottom 0.2s;
transition: margin-bottom 0.2s;
z-index: 3;
}
.site-branding a {
text-decoration: none;
-webkit-transition: opacity 0.2s;
transition: opacity 0.2s;
}
.site-branding a:hover,
.site-branding a:focus {
opacity: 0.7;
}
.site-title {
clear: none;
font-size: 24px;
font-size: 1.5rem;
font-weight: 800;
line-height: 1.25;
letter-spacing: 0.08em;
margin: 0;
padding: 0;
text-transform: uppercase;
}
.site-title,
.site-title a {
color: #222;
opacity: 1; /* Prevent opacity from changing during selective refreshes in the customize preview */
}
body.has-header-image .site-title,
body.has-header-video .site-title,
body.has-header-image .site-title a,
body.has-header-video .site-title a {
color: #fff;
}
.site-description {
color: #666;
font-size: 13px;
font-size: 0.8125rem;
margin-bottom: 0;
}
body.has-header-image .site-description,
body.has-header-video .site-description {
color: #fff;
opacity: 0.8;
}
.custom-logo-link {
display: inline-block;
padding-right: 1em;
vertical-align: middle;
width: auto;
}
.custom-logo-link img {
display: inline-block;
max-height: 80px;
width: auto;
}
body.home.title-tagline-hidden.has-header-image .custom-logo-link img,
body.home.title-tagline-hidden.has-header-video .custom-logo-link img {
max-height: 200px;
max-width: 100%;
}
.custom-logo-link a:hover,
.custom-logo-link a:focus {
opacity: 0.9;
}
body:not(.title-tagline-hidden) .site-branding-text {
display: inline-block;
vertical-align: middle;
}
.custom-header {
position: relative;
}
.has-header-image.twentyseventeen-front-page .custom-header,
.has-header-video.twentyseventeen-front-page .custom-header,
.has-header-image.home.blog .custom-header,
.has-header-video.home.blog .custom-header {
display: table;
height: 300px;
height: 75vh;
width: 100%;
}
.custom-header-media {
bottom: 0;
left: 0;
overflow: hidden;
position: absolute;
right: 0;
top: 0;
width: 100%;
}
.custom-header-media:before {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0+0,0.3+75 */
background: -moz-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#00000000", endColorstr="#4d000000", GradientType=0); /* IE6-9 */
bottom: 0;
content: "";
display: block;
height: 100%;
left: 0;
position: absolute;
right: 0;
z-index: 2;
}
.has-header-image .custom-header-media img,
.has-header-video .custom-header-media video,
.has-header-video .custom-header-media iframe {
position: fixed;
height: auto;
left: 50%;
max-width: 1000%;
min-height: 100%;
min-width: 100%;
min-width: 100vw; /* vw prevents 1px gap on left that 100% has */
width: auto;
top: 50%;
padding-bottom: 1px; /* Prevent header from extending beyond the footer */
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.wp-custom-header .wp-custom-header-video-button { /* Specificity prevents .color-dark button overrides */
background-color: rgba(34, 34, 34, 0.5);
border: 1px solid rgba(255, 255, 255, 0.6);
color: rgba(255, 255, 255, 0.6);
height: 45px;
overflow: hidden;
padding: 0;
position: fixed;
right: 30px;
top: 30px;
-webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out;
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out;
width: 45px;
}
.wp-custom-header .wp-custom-header-video-button:hover,
.wp-custom-header .wp-custom-header-video-button:focus { /* Specificity prevents .color-dark button overrides */
border-color: rgba(255, 255, 255, 0.8);
background-color: rgba(34, 34, 34, 0.8);
color: #fff;
}
.admin-bar .wp-custom-header-video-button {
top: 62px;
}
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
bottom: 0;
position: absolute;
top: auto;
-ms-transform: translateX(-50%) translateY(0);
-moz-transform: translateX(-50%) translateY(0);
-webkit-transform: translateX(-50%) translateY(0);
transform: translateX(-50%) translateY(0);
}
/* For browsers that support 'object-fit' */
@supports ( object-fit: cover ) {
.has-header-image .custom-header-media img,
.has-header-video .custom-header-media video,
.has-header-video .custom-header-media iframe,
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
height: 100%;
left: 0;
-o-object-fit: cover;
object-fit: cover;
top: 0;
-ms-transform: none;
-moz-transform: none;
-webkit-transform: none;
transform: none;
width: 100%;
}
}
/* Hides div in Customizer preview when header images or videos change. */
body:not(.has-header-image):not(.has-header-video) .custom-header-media {
display: none;
}
.has-header-image.twentyseventeen-front-page .site-branding,
.has-header-video.twentyseventeen-front-page .site-branding,
.has-header-image.home.blog .site-branding,
.has-header-video.home.blog .site-branding {
display: table-cell;
height: 100%;
vertical-align: bottom;
}
header-image.php HTML:
<?php
/**
* Displays header media
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?>
<div class="custom-header">
<div class="custom-header-media">
<?php the_custom_header_markup(); ?>
</div>
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
</div><!-- .custom-header -->
最佳答案
似乎样式在一个单独的文件中。这应该可以解决您的问题:
@media(min-width: 768px) {
.blog .custom-header {
margin-bottom: 0;
}
}
也许你必须使用 margin-bottom: 0; !重要
关于html - header 上的未知样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48289092/
我在让“@header”或任何其他@规则在ANTLR中工作时遇到麻烦。具有非常基本的语法,如下所示: grammar test; options { language = CSharp2;
我对来源和寄宿有疑问 我有一个ajax页面“Page A”,它将称为ajax提要“Page B” 我看到来自ajax调用的“页面B”的请求 header 具有源“http://mydomain.com
我在 pandas 中使用了数据透视表并获得了所需的数据框格式,但现在我有两行标题。数据透视表后的结果数据框如下: scenario Actual Plan
我在 pandas 中使用了数据透视表并获得了所需的数据框格式,但现在我有两行标题。数据透视表后的结果数据框如下: scenario Actual Plan
我想在主机将它们发送到网络之前修改数据包头(IP 头、TCP 头)。 例如,如果我使用 firefox 进行浏览,那么我想拦截所有来自 firefox 的数据包并修改 IP/TCP header ,然
我的 header 内容被包装到#header 中,但是当我设置边框显示结构时,它显示我的#header 的内容出现在#header 本身之后。可能是什么问题?这是我的代码: #header { bo
我是一名 Web 开发人员,使用过 PHP 和 .NET。有一年多的 Web 工作经验,我一直无法彻底了解浏览器缓存功能,希望这里的 Web Gurus 可以帮助我。我心中的问题是: 浏览器实际上是如
伙计们,我有一个问题,我不知道如何在一个 header 中连接多个 header ,我们称它为“主 header ”并使用该 header 中的函数,例如 // A.h #include class
我有一个包含 SOAP 消息的 XMLHTTPRequest。 我想添加用于标识消息并将由 C# Web 服务使用的 guid。 GUID 的目标是识别特定用户,并应护送所有用户请求以在服务器上进行身
我一直在阅读粘性标题,这是我目前所发现的。第一个粘性 header 效果很好,但是当它遇到第一个 header 时,我如何向上滚动第一个 header 并使第二个 header 卡住? http://
我想将当前基于 TableView 的数据网格转换为新的 UICollectionView 类。 这就是我当前的网格的样子: 我的网格有两个标题: 年份(2006a、2007a 等)和 类型(“收入”
我目前正在使用 Apollo 服务器。我正在尝试在响应 header 中设置一个属性。并且此属性是从客户端 graphQL 请求 header 中检索的。 我在网上查了一下。并看到了诸如使用插件或扩展
我的 Controller 的方法需要设置一个标题,例如X-Authorization .创建新对象( store Action )后,我执行转发以显示新创建的对象( show Action ): $
我正在研究一些关于 VLAN 的事情,发现了 VLAN 标签 和 header 。 如果我们有标准 802.3 以太网帧 的 MTU(1518 字节), header 802.3 中包含什么? 另外,
我是放心和 Java 的新手,我正在尝试做一个非常基本的测试来检查 API 的响应是否为 200 ok。 谁能告诉我我需要在下面的脚本中更改什么才能传递多个 header Id、Key 和 ConId
在我的项目中,我需要知道 zlib header 是什么样的。我听说它相当简单,但我找不到 zlib header 的任何描述。 例如,它是否包含魔数(Magic Number)? 最佳答案 zlib
我正在使用 JMeter 测试 HTTP 服务器,该服务器接受并验证 APIKey 并在成功时返回一个有时限的 token 。如果我有 token ,我想发送一个 token ;如果没有,我想发送一个
以太网 header 是什么样的? 是吗: 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|
我们的应用程序支持 CORS 配置 header 。我在两个不同的主机上分别配置了 testApp。两种设置都相互独立工作。host1 上的应用程序配置有 CORS header Access-Con
tlhelp32.h 不包含 windows.h 本身是有原因的吗?我一直在与大量的编译器错误作斗争,因为我在包含 tlhelp32.h 之后包含了 windows.h。这是设计决定还是出于什么原因?
我是一名优秀的程序员,十分优秀!