CSS不适用于母版页

CSS不适用于母版页

本文介绍了CSS不适用于母版页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.net中使用母版页。对于我已经添加了一些头部和页脚头部分的页眉和页脚的页眉和页脚我已经引用了css文件,在ContentPlaceHolder我已经反映了web表单....当我运行wesite css是

i am using masterpage in ASP.net. for the header and footer for which i have added some contents for header and footers in the head section of the masterpage i have referenced css files and in the ContentPlaceHolder i have refrenced a web form....when i run the wesite the css is not applied rather it shows error which i am not getting.

这是错误的形象:

this is the image of the error:

这里是masterpage的代码(MasterPage.master):

here is the code for masterpage(MasterPage.master):

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>


    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="Aviators, http://themes.byaviators.com"/>

    <link rel="shortcut icon" href="wp-content/themes/realia/assets/img/favicon.png" type="image/png"/>
    <link rel="profile" href="http://gmpg.org/xfn/11"/>
    <link rel="pingback" href="xmlrpc.php"/>

    <!--[if lt IE 9]>
        <script src="http://wp.realia.byaviators.com/wp-content/themes/realia/assets/js/html5.js" type="text/javascript"></script>
    <![endif]-->

                    <script type="text/javascript">
                        var bhittani_plugin_kksr_js = { "nonce": "5e4653d004", "grs": false, "ajaxurl": "http:\/\/wp.realia.byaviators.com\/wp-admin\/admin-ajax.php", "func": "kksr_ajax", "msg": "", "fuelspeed": 400, "thankyou": "", "error_msg": "An error occurred", "tooltip": "0", "tooltips": [{ "tip": "", "color": "#ffffff" }, { "tip": "", "color": "#ffffff" }, { "tip": "", "color": "#ffffff" }, { "tip": "", "color": "#ffffff" }, { "tip": "", "color": "#ffffff" }] };
                </script>




                <link rel='stylesheet' id='bootstrap-css'  href='wp-content/themes/realia/assets/libraries/bootstrap/css/bootstrap.minf9b8.css?ver=4.0' type='text/css' media='all' runat="server"/>

                <link rel='stylesheet' id='bootstrap-responsive-css'  href='wp-content/themes/realia/assets/libraries/bootstrap/css/bootstrap-responsive.minf9b8.css?ver=4.0' type='text/css' media='all' runat="server"/>

                <link rel='stylesheet' id='chosen-css'  href='wp-content/themes/realia/assets/libraries/chosen/chosenf9b8.css?ver=4.0' type='text/css' media='all' />

                <link rel='stylesheet' id='colorbox-css'  href='wp-content/themes/realia/assets/libraries/colorbox/example1/colorboxf9b8.css?ver=4.0' type='text/css' media='all' />

                <link rel='stylesheet' id='general_variant-css'  href='wp-content/themes/realia/assets/css/realia-bluef9b8.css?ver=4.0' type='text/css' media='all' />

                <link rel='stylesheet' id='style-css'  href='wp-content/themes/realia/stylef9b8.css?ver=4.0' type='text/css' media='all' />

                <script type='text/javascript' src='wp-includes/js/jquery/jquery90f9.js?ver=1.11.1'></script>

                <script type='text/javascript' src='wp-includes/js/jquery/jquery-migrate.min1576.js?ver=1.2.1'></script>

                <script type='text/javascript' src='wp-content/plugins/kk-star-ratings/js.min7793.js?ver=2.4'></script>

                <script type='text/javascript' src='wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.tools.min17d1.js?rev=4.6.0&amp;ver=4.0'></script>

                <script type='text/javascript' src='wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.revolution.min17d1.js?rev=4.6.0&amp;ver=4.0'></script>

                <link rel="EditURI" type="application/rsd+xml" title="RSD" href="xmlrpc0db0.php?rsd" />

                <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="wp-includes/wlwmanifest.xml" />

                <meta name="generator" content="WordPress 4.0" />

                <link rel='shortlink' href='index.html' />

                <style>
.kk-star-ratings { width:120px; }

.kk-star-ratings .kksr-stars a { width:24px; }

.kk-star-ratings .kksr-stars, .kk-star-ratings .kksr-stars .kksr-fuel, .kk-star-ratings .kksr-stars a { height:24px; }

.kk-star-ratings .kksr-star.gray { background-image: url(wp-content/plugins/kk-star-ratings/gray.png); }

.kk-star-ratings .kksr-star.yellow { background-image:url(http://wp.realia.byaviators.com/wp-content/plugins/kk-star-ratings/yellow.png); }

.kk-star-ratings .kksr-star.orange { background-image: url(http://wp.realia.byaviators.com/wp-content/plugins/kk-star-ratings/orange.png); }</style>

                <script type="text/javascript">var icl_lang = 'en'; var icl_home = 'index.html';</script>

                <script type="text/javascript" src="wp-content/plugins/sitepress-multilingual-cms/res/js/sitepress.js"></script>

                <meta name="generator" content="WPML ver:2.9.1 stt:1,4,3;0" />

                <link rel="alternate" hreflang="fr-FR" href="fr/index.html" />

                <link rel="alternate" hreflang="de-DE" href="de/index.html" />

                <link rel="stylesheet" href="#" type="text/css" id="color-variant">

                <title>Welcome to Our Website!</title>

                <link rel="stylesheet" href="wp-content/plugins/sitepress-multilingual-cms/res/css/language-selectorb253.css?v=2.9.1" type="text/css" media="all" />













</head>
<body class="home page page-id-53 page-template page-template-page-properties-grid-php  header-light color-blue pattern-none layout-wide ">
    <form id="form1" runat="server">



        <div id="wrapper-outer">
    <div id="wrapper">
        <div id="wrapper-inner">
            <div class="header-top-wrapper">
                <div class="header-top">
                        <div class="breadcrumb-wrapper">
        <div class="container">
            <div class="row">
                <div class="span12">
                                                                <div class="breadcrumb pull-left">
                                                            <!-- Breadcrumb NavXT 5.1.1 -->
Realia
                                                    </div><!-- /.breadcrumb -->

                                                                <div class="account pull-right">

</ul></div>

                        </div>
                                    </div><!-- /.span12 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </div><!-- /.breadcrumb-wrapper -->

                    <!-- HEADER -->
                    <div id="header-wrapper">
                        <div id="header">
                            <div id="header-inner">
                                <div class="container">
                                    <div class="navbar">
                                        <div class="navbar-inner">
                                            <div class="row">
                                                <div class="logo-wrapper span4">
                                                    <a href="#nav" id="btn-nav">Toggle navigation</a>

                                                                                                        <div class="logo">
                                                                                                                    <a href="index.html" title="Home">
                                                                                                                                                                                    <img src="wp-content/themes/realia/assets/img/logo.png" alt="Home">
                                                                                                                    </a>
                                                    </div><!-- /.logo -->

                                                                                                                                                                                                                            <div class="site-name">
                                                                <a href="index.html" title="Home" class="brand">
                                                                    Realia
                                                                </a>
                                                            </div><!-- /.site-name -->

                                                                                                                                                                                                                            <div class="site-slogan">
                                                                <span>Real estate & Rental <br>made easy</span>
                                                            </div><!-- /.site-slogan -->
                                                                                                                                                            </div><!-- /.logo-wrapper -->

                                                                                                    <div class="info">
                                                                                                                                                                            <div class="site-email">
                                                                <a href="mailto:[email protected]">
                                                                    [email protected]
                                                                </a>
                                                            </div><!-- /.site-email -->

                                                                                                                                                                            <div class="site-phone">
                                                                <span>333-444-555</span>
                                                            </div><!-- /.site-phone -->
                                                                                                            </div><!-- /.info -->


                                                    <a class="btn btn-primary btn-large list-your-property arrow-right"
                                                        href="my-properties/index.html">
                                                        List your property
                                                    </a>
                                                                                            </div><!-- /.row -->
                                        </div><!-- /.navbar-inner -->
                                    </div><!-- /.navbar -->
                                </div><!-- /.container -->
                            </div><!-- /#header-inner -->
                        </div><!-- /#header -->
                    </div><!-- /#header-wrapper -->
                </div><!-- /.top -->
            </div><!-- /.top-wrapper -->

            <!-- NAVIGATION -->
            <div id="navigation">
                <div class="container">
                    <div class="navigation-wrapper">
                        <div class="navigation clearfix-normal">
                            <div class="menu-main-container">
                                <ul id="menu-main" class="nav">
                                    <li id="menu-item-355" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children menu-item-355">
                                        <asp:HyperLink ID="NavHome" NavigateUrl="~/Index.aspx" runat="server">Home</asp:HyperLink>
                                      </li>
                                   <li id="menu-item-78" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menuparent menu-item-78"><asp:HyperLink ID="NavSale" NavigateUrl="~/properties.aspx" runat="server">Sale</asp:HyperLink>

                                    <ul class="sub-menu">
                                            <li id="menu-item-52" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-52"><a href="blog/index.html">Apartment</a></li>
                                            <li id="menu-item-148" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-148"><a href="right-sidebar/index.html">Commercial</a></li>
                                            <li id="menu-item-137" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-137"><a href="login/index.html">Residential</a></li>
                                            <li id="menu-item-149" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-149"><a href="left-sidebar/index.html">Land</a></li>

                                       </ul>

                                  </li>
                                  <li id="menu-item-78" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menuparent menu-item-78"><asp:HyperLink ID="NavPurchase" NavigateUrl="~/properties.aspx" runat="server">Purchase</asp:HyperLink>

                                    <ul class="sub-menu">
                                            <li id="menu-item-52" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-52"><a href="blog/index.html">Apartment</a></li>
                                            <li id="menu-item-148" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-148"><a href="right-sidebar/index.html">Commercial</a></li>
                                            <li id="menu-item-137" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-137"><a href="login/index.html">Residential</a></li>
                                            <li id="menu-item-149" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-149"><a href="left-sidebar/index.html">Land</a></li>
                                            <li id="menu-item-136" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-136"><a href="register/index.html">All</a></li>
                                       </ul>

                                  </li>
                                  <li id="menu-item-56" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-56"><asp:HyperLink ID="NavAgents" NavigateUrl="~/agents.aspx" runat="server">Agents</asp:HyperLink>
                                  </li>
                                  <li id="menu-item-56" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-56">
                                        <a href="agents/index.html">Construction</a>
                                  </li>
                                  <li id="menu-item-63" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-63"><asp:HyperLink ID="NavContact" NavigateUrl="~/contact-us.aspx" runat="server">Contact us</asp:HyperLink></li>
                            </ul>

                            </div>

                            <div id="icl_lang_sel_widget" class="widget icl_languages_selector"><div id="lang_sel"  >
    <ul>
        <li><a href="#" class="lang_sel_sel icl-en">

            <img  class="iclflag" src="wp-content/plugins/sitepress-multilingual-cms/res/flags/en.png" alt="en"  title="English" />
            &nbsp;English</a>
            <ul>
                                                <li class="icl-fr">
                    <a rel="alternate" hreflang="fr" href="fr/index.html">

                    <img  class="iclflag" src="wp-content/plugins/sitepress-multilingual-cms/res/flags/fr.png" alt="fr" title="Français" />&nbsp;
                                        Français                    </a>
                </li>
                                <li class="icl-de">
                    <a rel="alternate" hreflang="de" href="de/index.html">

                    <img  class="iclflag" src="wp-content/plugins/sitepress-multilingual-cms/res/flags/de.png" alt="de" title="Deutsch" />&nbsp;
                                        Deutsch                    </a>
                </li>
                            </ul>

                    </li>
    </ul>
</div>
</div>                                                                                                                </div><!-- /.navigation -->
                    </div><!-- /.navigation-wrapper -->
                </div><!-- /.container -->
            </div><!-- /.navigation -->


    <!-- /.map -->
</div><!-- /.map-wrapper -->        </div><!-- /.top-inner -->

        </div>







    <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>







<div id="wrapper-outer">
    <div id="wrapper">
        <!-- /#wrapper-inner -->

                <!-- /.bottom-wrapper -->


            <div id="footer-wrapper">
                                    <div id="footer-top">
                        <div id="footer-top-inner" class="container">
                            <div class="row">
                                <div class="span3">
                                    <div id="featuredproperties_widget-3" class="widget properties">

    <h2>Featured</h2>

<div class="content">
                        <div class="property">
    <div class="image">
        <a href="properties/3412-cloudcroft-dr-2-2/index.html"></a>
                    <img src="wp-content/uploads/2013/05/property-small-6-240x177.png" alt="3412 Cloudcroft Dr">
            </div>
    <!-- /.image -->

    <div class="wrapper">
        <div class="title">
            <h3><a href="properties/3412-cloudcroft-dr-2-2/index.html">
                                            3412 Cloudcroft Dr
                                    </a></h3>
        </div>
        <!-- /.title -->

        <div class="location">Jeff Blvd 1</div>
        <!-- /.location -->

        <div class="price">
                            Sold
                    </div>
        <!-- /.price -->
    </div>
    <!-- /.wrapper -->
</div>                    <div class="property">
    <div class="image">
        <a href="properties/3412-cloudcroft-dr-2-2/index.html"></a>
                    <img src="wp-content/uploads/2013/05/property-small-4-240x177.png" alt="1030 Palo Alto Ave">
            </div>
    <!-- /.image -->

    <div class="wrapper">
        <div class="title">
            <h3><a href="properties/3412-cloudcroft-dr-2-2/index.html">
                                            1030 Palo Alto Ave
                                    </a></h3>
        </div>
        <!-- /.title -->

        <div class="location">Palo Alto, SA</div>
        <!-- /.location -->

        <div class="price">
                            486000 €                     </div>
        <!-- /.price -->
    </div>
    <!-- /.wrapper -->
</div>                    <div class="property">
    <div class="image">
        <a href="properties/3412-cloudcroft-dr-2-2/index.html"></a>
                    <img src="wp-content/uploads/2013/05/property-small-3-240x177.png" alt="1041 Fife Ave">
            </div>
    <!-- /.image -->

    <div class="wrapper">
        <div class="title">
            <h3><a href="properties/3412-cloudcroft-dr-2-2/index.html">
                                            1041 Fife Ave
                                    </a></h3>
        </div>
        <!-- /.title -->

        <div class="location">Palo Alto, SA</div>
        <!-- /.location -->

        <div class="price">
                            450000 €                     </div>
        <!-- /.price -->
    </div>
    <!-- /.wrapper -->
</div>            </div><!-- /.content -->

</div>                                </div>

                                <div class="span3">
                                    <div id="text-5" class="widget widget_text"><h2>Contact</h2>            <div class="textwidget"><table class="contact">
    <tbody>
    <tr>
        <th class="address">Address:</th>
        <td>1900 Pico Blvd<br>Santa Monica, CA 90405<br>United States<br></td>
    </tr>
    <tr>
        <th class="phone">Phone:</th>
        <td>+48 123 456 789</td>
    </tr>
    <tr>
        <th class="email">E-mail:</th>
        <td><a href="mailto:[email protected]">[email protected]</a></td>
    </tr>
    <tr>
        <th class="skype">Skype:</th>
        <td>your.company</td>
    </tr>
    <tr>
        <th class="gps">GPS:</th>
        <td>34.016811<br>-118.469009</td>
    </tr>
    </tbody>
</table></div>
        </div>                                </div>

                                <div class="span3">
                                    <div id="nav_menu-3" class="widget widget_nav_menu"><h2>Useful Links</h2><div class="menu-useful-links-container"><ul id="menu-useful-links" class="menu"><li id="menu-item-403" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-403"><a href="revolution-slider/index.html">Revolution Slider</a></li>
<li id="menu-item-206" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-206"><a href="fully-responsive/index.html">Fully Responsive</a></li>
<li id="menu-item-209" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-209"><a href="contact-us/index.html">Contact us</a></li>
<li id="menu-item-207" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-207"><a href="faq/index.html">FAQ</a></li>
<li id="menu-item-211" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-211"><a href="theme-customization-api/index.html">Customization API</a></li>
</ul></div></div>                                </div>

                                <div class="span3">
                                    <div id="text-6" class="widget widget_text"><h2>Say Hello!</h2>         <div class="textwidget"><div class="wpcf7" id="wpcf7-f28-o1" dir="ltr">
<div class="screen-reader-response"></div>
<form name="" action="http://wp.realia.byaviators.com/#wpcf7-f28-o1" method="post" class="wpcf7-form" novalidate="novalidate">
<div style="display: none;">
<input type="hidden" name="_wpcf7" value="28" />
<input type="hidden" name="_wpcf7_version" value="3.9.3" />
<input type="hidden" name="_wpcf7_locale" value="" />
<input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f28-o1" />
<input type="hidden" name="_wpnonce" value="732d5d9ba2" />
</div>
<div class="control-group name">
<div><label class="control-label">Name<span class="form-required" title="This field is required.">*</span></label></div>
<div class="controls">
                                             <span class="wpcf7-form-control-wrap your-name"><input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false" /></span>
                                        </div>
<p><!-- /.controls -->
                                    </div>
<p><!-- /.control-group -->
<div class="control-group email">
<div><label class="control-label">Email<span class="form-required" title="This field is required.">*</span></label></div>
<div class="controls">

                                                                            </ul>
                                </div><!-- /.content -->
                            </div><!-- /.span6 -->
                        </div><!-- /.row -->
                    </div><!-- /#footer-inner -->
                </div><!-- /#footer -->
            </div><!-- /#footer-wrapper -->
        </div><!-- /#wrapper-outer -->
    </div><!-- /#wrapper -->

            <!-- /.palette -->
            <script type="text/javascript">
                var _gaq = [["_setAccount", "UA-39841036-2"], ["_trackPageview"]];
                (function (d, t) {
                    var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
                    g.src = "../www.google-analytics.com/ga.js";
                    s.parentNode.insertBefore(g, s)
                }(document, "script"));
        </script>

</script>
<script type='text/javascript' src='wp-content/plugins/contact-form-7/includes/js/scripts657a.js?ver=3.9.3'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/libraries/colorbox/jquery.colorboxf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/jquery.bxslider.minf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='http://maps.googleapis.com/maps/api/js?v=3&amp;sensor=true&amp;libraries=places&amp;ver=4.0'></script>

<script type='text/javascript' src='wp-content/themes/realia/assets/js/bootstrap.minf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/retinaf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/gmap3.clustererf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/libraries/chosen/chosen.jquery.minf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/aviators/plugins/properties/assets/js/aviators-mapf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/libraries/iosslider/_src/jquery.iosslider.minf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/jquery.cookief9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/jquery.ezmarkf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/carouself9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-content/themes/realia/assets/js/realiaf9b8.js?ver=4.0'></script>
<script type='text/javascript' src='wp-includes/js/comment-reply.minf9b8.js?ver=4.0'></script>



    </form>
</body>
</html>


推荐答案

bootstrap-css不是有效的标识符。尝试给它一个不同的ID。

It's exactly what it says it is. "bootstrap-css" is NOT a valid identifier. Try giving it a different ID.

这篇关于CSS不适用于母版页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 09:39