2015-02-09 72 views
0

我正在使用流体布局通过Dreamweaver制作一个微型网站。在这里面,我有我的表内标题和横幅,像这样一个div下:不幸的是Div和表格在Firefox中不能正常工作

banner in Chrome

,在:

<div id="divHeader"> 
<table cellpadding="0" cellspacing="0" border="0" width="100%"> 
    <tbody> 
     <tr> 
      <td style="width: 30px;"></td> 
      <td style="vertical-align: middle; font-size: 1.3rem; font-weight: bold;"> 
       <p><span>Move Toward </span> <span class="hdr">Zero Unplanned Downtime</span></p> 
      </td> 
     </tr> 
     <tr> 
      <td colspan="2" style="text-align: center;"> 
        <img src="images/Mining_site_1192x181-12.png" alt=""/> 
      </td> 
     </tr> 
    </tbody> 
    </table> 
</div> 

在大多数浏览器,这个效果很好(包括移动浏览器)火狐,它的显示是这样的:

banner in Firefox

当我使用内置的检查Elemet,这是我看到我Ñ火狐:

Firefox Inspect Element

出于某种原因,该表被DIV元素外显示。该表中没有与之相关联的CSS类,并以此为一样,这是同级车divHeader的CSS:

#divHeader { 
    font-family: Arial; 
    background-color: #F89329; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #fff; 
    line-height: 1rem; 
    border: none; 
} 

是否有与在Firefox专区内表的问题吗?如果是这样,什么是一个好的解决方法?

这里是我的CSS代码:

@charset "utf-8"; 
/* Simple fluid media 
    Note: Fluid media requires that you remove the media's height and width attributes from the HTML 
    http://www.alistapart.com/articles/fluid-images/ 
*/ 
img, object, embed, video { 
    max-width: 100%; 
} 

a { 
    text-decoration: none; 
} 

a: hover { 
    color: #F59D51; 
    text-decoration: none; 
} 

/* IE 6 does not support max-width so default to width 100% */ 
.ie6 img { 
    width:100%; 
} 

/* 
    Dreamweaver Fluid Grid Properties 
    ---------------------------------- 
    dw-num-cols-mobile:  4; 
    dw-num-cols-tablet:  8; 
    dw-num-cols-desktop: 12; 
    dw-gutter-percentage: 25; 

    Inspiration from "Responsive Web Design" by Ethan Marcotte 
    http://www.alistapart.com/articles/responsive-web-design 

    and Golden Grid System by Joni Korpi 
    http://goldengridsystem.com/ 
*/ 

.fluid { 
    clear: both; 
    margin-left: 0; 
    width: 100%; 
    float: left; 
    display: block; 
} 

.fluidList { 
    list-style:none; 
    list-style-image:none; 
    margin:0; 
    padding:0;   
} 

/* Mobile Layout: 480px and below. */ 

.gridContainer { 
    margin-left: auto; 
    margin-right: auto; 
    width: 86.45%; 
    padding-left: 0.75%; 
    padding-right: 0.75%; 
    margin: auto; 
    clear: none; 
    float: none; 
    background-color: #fff; 
} 

.zeroMargin_mobile { 
    margin-left: 0; 
} 

.hide_mobile { 
    display: none; 
} 

#divEPMLogo { 
    background-color:#fff; 
} 

#divHeader { 
    font-family: Arial; 
    background-color: #F89329; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #fff; 
    line-height: 1rem; 
    border: none; 
} 

#divHeader td.tdBanner { 
    background-image: url(../images/Mining_site_v2_Banner480.png); 
    background-position: bottom; 
    background-repeat: no-repeat; 
    background-size: contain; 
    height: 181px; 
    max-width: 480px; 
    margin: 0px; 
} 

#divSubheader { 
    font-family: Arial; 
    background-color: #fff; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #4D4F44; 
    line-height: 1.3rem; 
    border: none; 
} 

div.divCnt { 
    width: 100%; 
    border: none; 
} 

#content header { 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: #4D4F44; 
    font-family: Arial; 
} 

#content article { 
    font-size: 1rem; 
    color: #818183; 
    font-family: Arial; 
} 

#content hr { 
    width: 100%; 
    height: 3px; 
    color: #FFD022; 
    background-color: #FFD022; 
    border: none; 
    margin-top: 0px; 
} 

div.divBack { 
    width: 100%; 
    text-align: center; 
} 

div.divBack a { 
    color: #818183; 
    font-size: 0.9rem; 
    font-family: Arial; 
    text-decoration: none; 
} 

div.divBack a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.divRMBtn { 
    color: #fff; 
    background-color: #F89329; 
    text-align: center; 
    font-size: 0.9rem; 
    width: 6rem; 
    padding: 3px 0px; 
    font-family: Arial; 
} 

div.divRMBtn a { 
    color: #fff; 
    text-decoration: none; 
} 

div.divRMBtn a:hover { 
    color: #fff; 
    text-decoration: none; 
} 

div.divSecFt { 
    font-size: 0.8rem; 
    font-style: italic; 
    font-family: Arial; 
    padding: 10px 0px; 
} 

div.divSecFt a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

div.divSecFt a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.container1 { 
    display:table-cell; 
    vertical-align: middle; 
    border: 1px solid black; 
    /*padding: 0px 0px 0px 30px;*/ 
    position: relative; 
    left: 30px; 
} 

div.divForm { 
    font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    font-size: 1rem; 
    text-align: left; width:50%; 
    height: 26rem; 
    min-width: 320px; 
    margin: 0 auto; 
    color:#4B4B4B; 
    border: none; 
} 

span.hdr { 
    color: #4D4F44; 
    text-wrap: none; 
} 

span.hdr2 { 
    color: #F59D51; 
    text-transform: uppercase; 
    font-size: 1.1rem; 
    font-weight: bold; 
} 

td.td-ico { 
    width: 73px; 
    max-width: 73px; 
    min-width: 73px; 
    text-align: center; 
    vertical-align: top; 
    padding-right: 5px; 
} 

.ulNltr{ 
    color: #4D4F44; 
    font-family: Arial; 
    font-size: 0.9rem; 
    line-height: 1rem; 
    margin-left: 0px; 
    padding-left: 15px; 
} 

.ulNltr li { 
    padding-bottom: 10px; 
    list-style-image:url(../images/icons/bullet.png) 
} 

.ulNltr li.q1 { 
    list-style-image:url(../images/icons/question_icon.jpg) 
} 

.ulNltr li.c1 { 
    list-style-image:url(../images/icons/contact_icon.jpg) 
} 

.ulNltr a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

.ulNltr a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

/* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */ 

@media only screen and (min-width: 481px) { 

.gridContainer { 
    margin-left: auto; 
    margin-right: auto; 
    width: 90.675%; /*width: 480px;*/ 
    padding-left: 0.75%; 
    padding-right: 0.75%; 
    margin: auto; 
    clear: none; 
    float: none; 
    background-color: #fff; 
} 

.zeroMargin_tablet { 
    margin-left: 0; 
} 

.hide_tablet { 
    display: none; 
} 

#divEPMLogo { 
    background-color:#fff; 
} 

#divHeader { 
    font-family: Arial; 
    background-color: #F89329; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #fff; 
    line-height: 1rem; 
    border: none; 
} 

#divHeader td.tdBanner { 
    background-image: url(../images/Mining_site_v2_Banner768.png); 
    background-position: bottom; 
    background-repeat: no-repeat; 
    background-size: contain; 
    height: 181px; 
    max-width: 480px; 
    margin: 0px; 
} 

#divSubheader { 
    font-family: Arial; 
    background-color: #fff; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #4D4F44; 
    line-height: 1.3rem; 
    border: none; 
} 

div.divCnt { 
    width: 100%; 
    border: none; 
} 

#content header { 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: #4D4F44; 
    font-family: Arial; 
} 

#content article { 
    font-size: 1rem; 
    color: #818183; 
    font-family: Arial; 
} 

#content hr { 
    width: 100%; 
    height: 3px; 
    color: #FFD022; 
    background-color: #FFD022; 
    border: none; 
    margin-top: 0px; 
} 

div.divBack { 
    width: 100%; 
    text-align: center; 
} 

div.divBack a { 
    color: #818183; 
    font-size: 0.9rem; 
    font-family: Arial; 
    text-decoration: none; 
} 

div.divBack a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.divRMBtn { 
    color: #fff; 
    background-color: #F89329; 
    text-align: center; 
    font-size: 0.9rem; 
    width: 6rem; 
    padding: 3px 0px; 
    font-family: Arial; 
} 

div.divRMBtn a { 
    color: #fff; 
    text-decoration: none; 
} 

div.divRMBtn a:hover { 
    color: #fff; 
    text-decoration: none; 
} 

div.divSecFt { 
    font-size: 0.8rem; 
    font-style: italic; 
    font-family: Arial; 
    padding: 10px 0px; 
} 

div.divSecFt a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

div.divSecFt a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.container1 { 
    display:table-cell; 
    vertical-align: middle; 
    border: 1px solid black; 
    /*padding: 0px 0px 0px 30px;*/ 
    position: relative; 
    left: 30px; 
} 

div.divForm { 
    font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    font-size: 1rem; 
    text-align: left; width:50%; 
    height: 26rem; 
    min-width: 320px; 
    margin: 0 auto; 
    color:#4B4B4B; 
    border: none; 
} 

span.hdr { 
    color: #4D4F44; 
    text-wrap: none; 
} 

span.hdr2 { 
    color: #F59D51; 
    text-transform: uppercase; 
    font-size: 1.1rem; 
    font-weight: bold; 
} 

td.td-ico { 
    width: 73px; 
    max-width: 73px; 
    min-width: 73px; 
    text-align: center; 
    vertical-align: top; 
    padding-right: 5px; 
} 

.ulNltr{ 
    color: #4D4F44; 
    font-family: Arial; 
    font-size: 0.8rem; 
    line-height: 1rem; 
} 

.ulNltr li { 
    padding-bottom: 10px; 
    list-style-image:url(../images/icons/bullet.png) 
} 

.ulNltr a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

.ulNltr a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 
} 

/* Desktop Layout: 769px to a max of 1079px. Inherits styles from: Mobile Layout and Tablet Layout. */ 

@media only screen and (min-width: 769px) { 

.gridContainer { 
    width: 88.5%; /*width: 768px;*/ 
    max-width: 768px; 
    padding-left: 0.75%; 
    padding-right: 0.75%; 
    margin: auto; 
    clear: none; 
    float: none; 
    margin-left: auto; 
    margin-right: auto; 
    background-color: #fff; 
} 

.zeroMargin_desktop { 
    margin-left: 0; 
} 

.hide_desktop { 
    display: none; 
} 

#divEPMLogo { 
    background-color:#fff; 
} 

#divHeader { 
    font-family: Arial; 
    background-color: #F89329; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #fff; 
    line-height: 1rem; 
    border: none; 
} 

#divHeader td.tdBanner { 
    background-image: url(../images/Mining_site_v2_Banner768.png); 
    background-position: center; 
    background-repeat: no-repeat; 
    background-size: contain; 
    height: 181px; 
    max-width: 768px; 
    margin: 0px; 
} 

#divSubheader { 
    font-family: Arial; 
    background-color: #fff; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #4D4F44; 
    line-height: 1.3rem; 
    border: none; 
} 

div.divCnt { 
    width: 33%; 
    float: left; 
    border: none; 
} 

#content header { 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: #4D4F44; 
    font-family: Arial; 
} 

#content article { 
    font-size: 1rem; 
    color: #818183; 
    font-family: Arial; 
} 

#content hr { 
    width: 100%; 
    height: 3px; 
    color: #FFD022; 
    background-color: #FFD022; 
    border: none; 
    margin-top: 0px; 
} 

div.cntRw { 
    display: table-cell; 
} 

div.divBack { 
    width: 100%; 
    text-align: center; 
} 

div.divBack a { 
    color: #818183; 
    font-size: 0.9rem; 
    font-family: Arial; 
    text-decoration: none; 
} 

div.divBack a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.divRMBtn { 
    color: #fff; 
    background-color: #F89329; 
    text-align: center; 
    font-size: 0.9rem; 
    width: 6rem; 
    padding: 3px 0px; 
    font-family: Arial; 
} 

div.divRMBtn a { 
    color: #fff; 
    text-decoration: none; 
} 

div.divRMBtn a:hover { 
    color: #fff; 
    text-decoration: none; 
} 

div.divSecFt { 
    font-size: 0.8rem; 
    font-style: italic; 
    font-family: Arial; 
    padding: 10px 0px; 
} 

div.divSecFt a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

div.divSecFt a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.container1 { 
    display:table-cell; 
    vertical-align: middle; 
    border: 1px solid black; 
    /*padding: 0px 0px 0px 30px;*/ 
    position: relative; 
    left: 30px; 
} 

div.divForm { 
    font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    font-size: 1rem; 
    text-align: left; width:50%; 
    height: 26rem; 
    min-width: 320px; 
    margin: 0 auto; 
    color:#4B4B4B; 
    border: none; 
} 

span.hdr { 
    color: #4D4F44; 
    text-wrap: none; 
} 

span.hdr2 { 
    color: #F59D51; 
    text-transform: uppercase; 
    font-size: 1.1rem; 
    font-weight: bold; 
} 

td.td-ico { 
    width: 73px; 
    max-width: 73px; 
    min-width: 73px; 
    text-align: center; 
    vertical-align: top; 
    padding-right: 5px; 
} 

.ulNltr{ 
    color: #4D4F44; 
    font-family: Arial; 
    font-size: 0.8rem; 
    line-height: 1rem; 
} 

.ulNltr li { 
    padding-bottom: 10px; 
    list-style-image:url(../images/icons/bullet.png) 
} 

.ulNltr a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

.ulNltr a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 
} 

/* Desktop Layout: 1080p and beyond. Inherits styles from: Mobile Layout and Tablet Layout. */ 

@media only screen and (min-width: 1079px) { 

.gridContainer { 
    width: 88.5%; /*width: 1192px; */ 
    max-width: 1192px; 
    padding-left: 0.75%; 
    padding-right: 0.75%; 
    margin: auto; 
    clear: none; 
    float: none; 
    margin-left: auto; 
    margin-right: auto; 
    background-color: #fff; 
} 

.zeroMargin_desktop { 
    margin-left: 0; 
} 

.hide_desktop { 
    display: none; 
} 

#divEPMLogo { 
    background-color:#fff; 
} 

#divHeader { 
    font-family: Arial; 
    background-color: #F89329; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #fff; 
    line-height: 1rem; 
    border: none; 
    clear: right; 
} 

#divHeader td.tdBanner { 
    background-image: url(../images/Mining_site_1192x181-12.png); 
    background-position: center; 
    background-repeat: no-repeat; 
    background-size: contain; 
    height: 181px; 
    max-width: 1191px; 
    margin: 0px; 
} 

#divSubheader { 
    font-family: Arial; 
    background-color: #fff; 
    text-transform: uppercase; 
    font-size: 1rem; 
    color: #4D4F44; 
    line-height: 1.3rem; 
    border: none; 
} 

div.divCnt { 
    width: 33%; 
    float: left; 
    border: none; 
} 

#content header { 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: #4D4F44; 
    font-family: Arial; 
} 

#content article { 
    font-size: 1rem; 
    color: #818183; 
    font-family: Arial; 
} 

#content hr { 
    width: 100%; 
    height: 3px; 
    color: #FFD022; 
    background-color: #FFD022; 
    border: none; 
    margin-top: 0px; 
} 

div.cntRw { 
    display: table-cell; 
} 

div.divBack { 
    width: 100%; 
    text-align: center; 
    margin: 0px; 
} 

div.divBack a { 
    color: #818183; 
    font-size: 0.9rem; 
    font-family: Arial; 
    text-decoration: none; 
} 

div.divBack a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.divRM { 
    color: #818183; 
    font-size: 0.9rem; 
    font-family: Arial; 
} 

div.divRMBtn { 
    color: #fff; 
    background-color: #F89329; 
    text-align: center; 
    font-size: 0.9rem; 
    width: 6rem; 
    padding: 3px 0px; 
    font-family: Arial; 
} 

div.divRMBtn a { 
    color: #fff; 
    text-decoration: none; 
} 

div.divRMBtn a:hover { 
    color: #fff; 
    text-decoration: none; 
} 

div.divSecFt { 
    font-size: 0.8rem; 
    font-style: italic; 
    font-family: Arial; 
    padding: 10px 0px; 
} 

div.divSecFt a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

div.divSecFt a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 

div.container1 { 
    display:table-cell; 
    vertical-align: middle; 
    border: 1px solid black; 
    /*padding: 0px 0px 0px 30px;*/ 
    position: relative; 
    left: 30px; 
} 

div.divForm { 
    font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    font-size: 1rem; 
    text-align: left; width:50%; 
    height: 26rem; 
    min-width: 320px; 
    margin: 0 auto; 
    color:#4B4B4B; 
    border: none; 
} 

span.hdr { 
    color: #4D4F44; 
    text-wrap: none; 
} 

span.hdr2 { 
    color: #F59D51; 
    text-transform: uppercase; 
    font-size: 1.1rem; 
    font-weight: bold; 
} 

td.td-ico { 
    width: 73px; 
    max-width: 73px; 
    min-width: 73px; 
    text-align: center; 
    vertical-align: top; 
    padding-right: 5px; 
} 

.ulNltr{ 
    color: #4D4F44; 
    font-family: Arial; 
    font-size: 0.8rem; 
    line-height: 1rem; 
} 

.ulNltr li { 
    padding-bottom: 10px; 
    list-style-image:url(../images/icons/bullet.png) 
} 

.ulNltr a { 
    color: #4D4F44; 
    text-decoration: none; 
} 

.ulNltr a:hover { 
    color: #F89329; 
    text-decoration: none; 
} 
} 
+0

尽量有效你的HTML文件第一HTTP:// validator.w3.org/查看是否有任何额外/未关闭的标签... – Stickers 2015-02-09 01:53:06

+0

尝试添加: 明确:正确; – 2015-02-09 01:53:24

+0

@sdcr我试过验证器,没有未关闭的taqs :( – Poch 2015-02-09 03:44:51

回答

0

它似乎是Firefox是具有与该专区内的表的问题。我改变了HTML部分如下:

\t <!-- Page header and banner --> 
 
    \t <div id="divHeader"> 
 
    \t \t <div style="display: table-cell; vertical-align: middle;"> 
 
    \t \t \t <p>Move Toward <span class="hdr">Zero Unplanned Downtime</span></p> 
 
    \t </div> 
 
    \t </div> 
 
    
 
    \t <div id="divHBanner"> 
 
    \t \t <img src="images/Mining_site_1192x181-12.png" alt=""/> 
 
    \t </div> 
 
    <!-- End Page header and banner -->

它修正原来的错误,但它开辟了另一个。相反,我将发布一个单独的问题。

0

我曾试图和的jsfiddle在我的网页测试页面,一切正常,当我删除@charset"utf-8";

当我再次设置它,它去再次相撞

相关问题