CSS背景颜色在DW中有效,但在浏览器中无效

时间:2015-01-08 22:51:04

标签: html css background

页面有问题 - www.pointbank.com/testerfile /

我在default.css文件中创建了一个div id - div id =“PBredbackground600”,以便我可以更改整个内容的背景颜色 - div id =“content” - 网站上某个特定页面的背景部分。我已经使用了img和颜色(六个十六进制),并且可以让它们在DreamWeaver中完美呈现。但是在Chrome或IE中都不起作用。我没有得到什么?

整个HTML代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/default.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>PointBank Loans | Denton County Community Bank, Texas</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<meta name="description" content="PointBank has the right financing for personal or business loans at competitive terms." />
<meta name="keywords" content="pointbank loans, pointbank personal loan, pointbank business loan, denton county loan, personal loans denton tx., business loan texas" />


<!-- InstanceEndEditable -->

<link href="/includes/css/default.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 8]>
<link href="/includes/css/ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 6]>
<link href="/includes/css/ie6.css" rel="stylesheet" type="text/css" />
<script src="/includes/js/ddbelatedpng.js"></script>
<script>DD_belatedPNG.fix('img, div, p, a, input');</script>
<![endif]-->
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
<script src="/includes/js/default.js"></script>

<!-- InstanceParam name="showBreadcrumb" type="boolean" value="true" -->

<?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/analytics.php'); ?>
</head>

<body <?php if( $is_homepage ) { echo 'class="homepage"'; } ?>>

<div id="header">
    <a href="/" title="PointBank"><img src="/images/pointbank.png" width="220" height="92" alt="PointBank - Proudly Serving Denton County, Texas" /></a>
    <p id="top"><a href="/" title="PointBank">Home</a> | <a href="/contact-us/" title="Contact Us">Contact Us</a> | <a href="/about-us/locations/" title="Locations">Locations</a> | <a href="https://www.pcsbanking.net/onlinebanking1/login.r?t-bank=111906006" title="Online Banking" target="_blank">Online Banking</a></p>
    <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/menu.php'); ?>
</div>

<div id="online-banking">
    <!-- InstanceBeginEditable name="editHeader" --><img src="/images/headers/loans.png" width="704" height="168" alt="Loans at PointBank" /><!-- InstanceEndEditable -->
    <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/online-banking.php'); ?>
</div>

<div id="content">
    <?php if( $is_homepage ) { ?>
    <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/homepage.php'); ?>
    <?php } else { ?>
    <div id="page">
    <p id="breadcrumb"><a href="/">Home</a> &#8250; <!-- InstanceBeginEditable name="editBreadcrumb" --><span>Loans</span><!-- InstanceEndEditable --></p>
    <!-- InstanceBeginEditable name="editContent" -->


    <div id="PBredbackground600">




    <h2>PointBank Loan  Opportunities2</h2>
    <p>     As the leading Denton County community bank, PointBank has a  strong financial foundation that provides us with the lending power we need to  work with you on any size loan. With our local decision-making, you will find  us <strong>flexible and responsive to your personal or business needs</strong>.</p>
    <ul class="icons">
        <li><strong><a href="/personal-banking/loans/"><img src="/images/icons/checking-and-savings.png" alt="Personal Loans" width="48" height="48" />Personal  Loans</a></strong><br />
            Whatever your unique needs, we have the right financing for personal loans at competitive terms.</li>
        <li><strong><a href="/mortgage/"><img src="/images/icons/mortgage.png" alt="Mortgage Lending" width="48" height="48" />Mortgage  Lending</a></strong><br />
            PointBank Mortgage is a full service lender based in Denton County  that specializes in Conventional, USDA-Rural Development, FHA and VA loans.</li>
    </ul>
    <h6>For immediate loan pre-qualification or if you have any preliminary questions before you apply for a loan, call (940) 686-7000.</h6>

    </div>

    <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/usa-patriot-act.php'); ?>





    <!-- InstanceEndEditable -->
    </div>
    <div class="sidebar">
    <!-- InstanceBeginEditable name="editSidebar" -->



    <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/sidebar-loans.php'); ?>

    <!-- InstanceEndEditable -->
    <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/sidebar.php'); ?>
    </div>
    <?php } ?>
    <br clear="all" />

        <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/branches.php'); ?>




</div>

<?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/php/footer.php'); ?>

<?php if( $isBlog ) { ?>
<?php wp_footer(); ?>
<?php } ?>

这是default.css中的代码

#PBredbackground600 {
    background-color:#80FF00;
    font:"Comic Sans MS", cursive
}

这组代码显示使用颜色选项而不是图像文件,我还更改了字体以帮助识别代码是执行还是部分执行。在浏览器中不会显示颜色和字体更改,但在DW中工作正常。

这是开发工具代码。没有足够的代表进行图片上传。我没看到PBredbackground600 div的任何扩展,我想也许有一个div-page或div-content设置覆盖了div-PBredbackground600的正确显示,但是找不到它是什么,我看过了页面和内容标签上的default.css,但不知道代码是否足以识别覆盖命令或设置。

从chrome dev工具的样式选项卡复制

element.style {
}
*, body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, ul li, ol li, blockquote, form, fieldset, legend, object, param, hr {
margin: 0;
padding: 0;
}
*, body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, ul li, ol li, blockquote, form, fieldset, legend, object, param, hr {
margin: 0;
padding: 0;
}
user agent stylesheetdiv {
display: block;
}
Inherited from body
body {
font: normal 14px/22px Arial, Helvetica, sans-serif;
background: #b9cbcd url(/images/overall-background.jpg) no-repeat center top;
}

1 个答案:

答案 0 :(得分:0)

最好提供css,但这是你应该在你的css文件中使用它的方式:

div#PBredbackground600 { 
    background-color: yellow;
} 

根据提供的实际css进行更改,强制执行:

#PBredbackground600 {
    background-color:#80FF00 !important;
    font-family: "Comic Sans MS", cursive;
}