为什么内联css放在外部样式表上不起作用?

为什么内联css放在外部样式表上不起作用?,css,Css,css在外部样式表上不起作用 我正在为WordPress制作一个自定义标题。 我已经在本地主机中创建了头文件和代码,所有内容都可以很好地使用内联css,但是一旦我删除代码并将其放在外部样式表上,它就不起作用了。 我想知道为什么我不能复制内联css并将其与链接一起放置在外部 /==css===/ .header_panel { background-image: url("https://www.sellhousefast.uk/resources/purplegreen/template

css在外部样式表上不起作用

我正在为WordPress制作一个自定义标题。 我已经在本地主机中创建了头文件和代码,所有内容都可以很好地使用内联css,但是一旦我删除代码并将其放在外部样式表上,它就不起作用了。 我想知道为什么我不能复制内联css并将其与链接一起放置在外部

/==css===/

.header_panel {
    background-image: url("https://www.sellhousefast.uk/resources/purplegreen/template/header_background.v1541099273.png");
    background-repeat: repeat-y;
    margin-left: auto;
    margin-right: auto;
    background-position: center;
}

.inner_content {
    margin-left: auto;
    margin-right: auto;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
    max-width: 1190px;
  }

  body {
    font-family: 'museo_slab',sans-serif;
    color: #4c2060;
    font-size: 11pt;
}
.header_panel .logo {
    float: left;
    margin-top: 11px;
    margin-left: -7px;
}

fieldset, img {
border: 0;
}
.header_panel .rightinfo {
float: right;
font-size: 16pt;
margin-right: -7px;
}
.header_panel .rightinfo .taglinetel {
float: left;
text-align: right;
box-sizing: border-box;
padding-right: 7px;
margin-top: 15px;
}
.header_panel .rightinfo .taglinetel .tagline, .header_panel .rightinfo .taglinetel .tagline a {
color: #ffffff;
font-weight: bold;
text-decoration: none;
}
.header_panel .rightinfo .taglinetel .tagline, .header_panel .rightinfo .taglinetel .tagline a {
color: #ffffff;
font-weight: bold;
text-decoration: none;
}
.header_panel .rightinfo .taglinetel .telephone_number {
color: #4c2060;
}
标题代码:

<?php
    /**
     * The header for our theme
     *
     * This is the template that displays all of the <head> section and    everything up until <div id="content">
     *
     * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
     *
     * @package quick_completion
     */

    ?>
          <!doctype html>
    <html <?php language_attributes(); ?>>
     <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="https://gmpg.org/xfn/11">

    <?php wp_head(); ?>
<!-- HTML5 shiv and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>





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

    <!DOCTYPE html>
        <html>
    <div class="header_panel">
        <div class="inner_content">
         <header>
        <a href="https://www.quickcompletion.net" class="logo"><img src="http://www.quickcompletion.net/wp-content/uploads/2019/01/logo1.png" alt="quickcompletion.net" width="400" height="89"></a>
        <div class="rightinfo">
                        <div class="taglinetel">
                            <div class="tagline"><a href="https://www.quickcompletion.net">Quick Completion</a></div>
                            <div class="telephone_number telephone_number_desktop">
                                <div class="line">Call us FREE on <span class="number"></span></div>
                                <div class="line">Or for local rates <span class="number">0161 907 1594</span></div>
                            </div>
                            <div class="telephone_number telephone_number_mobile">
                                <div class="number">0161 907 1594</div>
                                <!--//<div class="line">Local rates</div>//-->
                            </div>
                        </div>
                        <img src="https://www.sellhousefast.uk/resources/purplegreen/template/code_of_practice.v1541099272.png" alt="Property Buyers - Code of Practice" class="code_of_practice" width="107" height="107">
                    </div>
                    <div class="clear"></div>



        <nav class="page_navigation" id="page_navigation">
            <ul>


         <li>
            <a href="https://www.quickcompletion.net/home/" class="name nav-home selected">Home</a>

                        </li>
                            <li>
    <a href="https://www.quickcompletion.net/faq/" class="name nav-faq nonselected">Stop repossession</a>

                            </li>
                            <li>
    <a href="https://www.quickcompletion.net/why-choose-us/" class="name nav-why-choose-us nonselected">FAQ</a>

                            </li>

                            <li>
    <a href="https://www.quickcompletion.net/testimonials/" class="name nav-testimonials nonselected">Testimonials</a>

                            </li>

                                <li>
        <a href="https://www.quickcompletion.net/contact-us/" class="name nav-contact-us nonselected">Get in touch</a>

                                </li>

                </ul>
                <div class="clear"></div>
             </nav>


                </div>
             <div></div></div>


    <?php
    wp_nav_menu(
    array(
    'theme_location' => 'primary',
    'container' => 'nav',
    'container_class' => 'navbar_collapse collapse',
    'menu_class' => 'nav navbar-nav navbar-left'

    )
    );
    ?>

       </header>


            <!-- Bootstrap core CSS -->
            <link href="assets/css/bootstrap.min.css" rel="stylesheet">

            <!-- Font Awesome Icons -->
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs    /font-awesome/4.7.0/css/font-awesome.min.css">
        <link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.5.0    /css/all.css' integrity='sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU' crossorigin='anonymous'>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

            <!-- Custom CSS -->

            <!-- Google Fonts -->
            <link href="https://fonts.googleapis.com/css?family=Fredoka+One|Libre+Baskerville|Open+Sans|Raleway" rel="stylesheet">

            <link href='http://fonts.googleapis.com/css?family=Raleway:400,700' rel='stylesheet' type='text/css'>


CSS规则将按照声明的顺序应用。您可以使用浏览器的内置开发人员工具来检查元素,并查看应用了哪些规则以及来自哪个电子表格


您还可以添加
!重要信息
在规则末尾,优先于稍后在另一个样式表中声明的同一元素的规则。

我已在WordPress样式末尾添加了相应的样式,但不明白它们为什么不连接。-我注意到它没有指向样式表目录。好吧,这是一个开始。如果提供的样本不完整,则很难诊断编码问题。你把样式表声明链接到它的URL了吗?我不这么认为我正试图找出header.php文件中缺少的内容,以便将其链接到WP样式。如果您包含自己制作的独立样式表,而不是主题或插件提供的样式表,您应该阅读以下内容:嗨,我所做的只是在原始样式表的底部添加一些额外的css。