0

我的网站是 www.rosstheexplorer.com

当设备宽度大于 601px 我希望发生以下情况

  1. 我不希望菜单和自定义标题之间有任何空格
  2. 我不希望客户标题上方有任何空间
  3. 我不希望 H1、插件或页面上的任何其他内容与客户标题重叠
  4. 我不希望客户标题的左侧或右侧有任何空白
  5. 我希望始终能够看到整个文本'Ross The Explorer',我不希望最后一个 R 被删除

查看 www.nomadicmatt.com 了解我想要实现的目标。

要将自定义标题放在自己的行中,我尝试使用以下代码

   <div class="row">

<div class="col-sm-12" style="background-color:lavender;">
  <div class="custom-header"></div>
</div>

 </div>

这似乎没有效果。

这是完整的 header.php 代码。

 <?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="content">
 *
 * @package Penscratch
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<

    head>
    <meta charset="<?ph

p bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php wp_title( 'A|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

    <?php wp_head(); ?>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-

        Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script

>


</head>

<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
    <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'penscratch' ); ?></a>


  <div class="custom-header"></div>



<header id="masthead" class="site-header" role="banner">
        <div class="site-branding">
            <?php if ( function_exists( 'jetpack_the_site_logo' ) ) jetpack_the_site_logo(); ?>
            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        </div>

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <button class="menu-toggle"><?php _e( 'Menu', 'penscratch' ); ?></button>
            <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
        </nav><!-- #site-navigation -->
    </header><!-- #masthead -->

    <div id="content" class="site-content">
        <?php if ( get_header_image() ) : ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">

            </a>
        <?php endif;  // End header image check. ?>

在 Additional CSS 我有以下代码

@media screen and (min-width: 75em)
{
  .site {
    max-width: 1153px;
    margin: 400px auto;
    padding: 54px 108px;
  }
}



@media screen and (min-width: 601px) {
 .custom-header { background: url("https://i1.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/02/Cover-Photo-6-2.jpg") no-repeat; 
        width: 100% ;
                        background-size:contain;


    }
}

包含新代码后,加载http://www.rosstheexplorer.com/wp-content/themes/penscratch/css/bootstrap-3.3.7.csshttp://www.rosstheexplorer.com/wp-content/themes /penscratch/js/bootstrap.min.js仍然导致 404 错误(未找到)。

人们可以就我可以尝试的其他代码给我建议吗?

谢谢

4

1 回答 1

0

是的,这是您的代码:

@media screen and (min-width: 601px)?custom-css=d4d401c306:9

.custom-header {
    background: url(https://i1.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/02/Cover-Photo-6-2.jpg) no-repeat;

    width: 100%;
    height: 40%;
    background-size: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* 改变背景尺寸:封面;到背景大小:100%;*/

 @media screen and (min-width: 601px)?custom-css=d4d401c306:9

.custom-header {
    background: url(https://i1.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/02/Cover-Photo-6-2.jpg) no-repeat;

    width: 100%;
    height: 40%;
    background-size: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
于 2017-05-30T07:29:32.023 回答