Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么valign=";底部“;不适用于firefox,但适用于IE和Chrome?_Html_Css_Firefox - Fatal编程技术网

Html 为什么valign=";底部“;不适用于firefox,但适用于IE和Chrome?

Html 为什么valign=";底部“;不适用于firefox,但适用于IE和Chrome?,html,css,firefox,Html,Css,Firefox,我有这个模板,在所有页面上使用 <table CELLPADDING=0; CELLSPACING=0; style="width:100%; min-height:100vh;"> <tr> <td style="vertical-align:top;"> [EP_CA:Header] </td> </tr> <tr> <

我有这个模板,在所有页面上使用

<table CELLPADDING=0; CELLSPACING=0; style="width:100%; min-height:100vh;">
    <tr>
        <td style="vertical-align:top;">
            [EP_CA:Header]
        </td>
    </tr>
    <tr>
        <td style="align:center; vertical-align:top; width:100%;">
            [EP_CA:Menu]
        </td>
    </tr>
    <tr>
        <td style="align:center; vertical-align:top; width:100%;">
            [EP_CA:SiteMap]
        </td>
    </tr>
    <tr>
        <td style="align:center; vertical-align:top; width:100%; height:100%">
            [EP_CA:Body]
        </td>
    </tr>
    <tr>
        <td class="footerBottom" style="vertical-align:bottom;">
            [EP_CA:Footer]
        </td>
    </tr>
</table>

[EP_CA:标题]
[EP_CA:菜单]
[EP_CA:网站地图]
[欧洲议会:机构]
[EP_CA:页脚]
我尝试对页脚td使用display=“block”,但也不起作用


编辑:我试图将页脚行与页面底部对齐,即使内容较少。这段代码适用于chrome,只是firefox没有响应。

为了跨浏览器兼容性,我建议您不要使用table属性,而是使用

<div> Header </div>
<div> Menu </div>
<div> SiteMap </div>
<div> Body </div>
<div position:relative; bottom:0px;"> Footer </div>
标题
菜单
网站地图
身体

使用CSS,您应该应用垂直对齐


如果您使用的是HTML5,valign将无法工作


使用CSS。

将最小高度:100vh更改为高度:100vh。
这对我很有用。

你为什么不使用flex
呢?现在你应该使用CSS来设计网页的样式,使用HTML属性已经10年了。我也在CSS中尝试过了。不起作用。你的HTML让我回想起大约1999年FrontPage生成的表格布局。它在今天的互联网上没有一席之地。使用CSS。不要将表格用于页面布局!使用CSS等效于不起作用的东西,也不会起作用。这是不推荐的。所以呢?浏览器仍然支持向后兼容。哦,真的吗?太棒了!我试过了。我能想到的所有变化。@Darshan你想实现什么?Valign可能不是最好的选择…我正在尝试将页脚行与页面底部对齐,即使内容较少。这段代码适用于chrome浏览器,只是firefox没有响应。我在页脚标记中使用了一个类,它实现了垂直对齐。它仍然没有将其与页面底部对齐。请共享该片段。这将更容易分析。在设计时,不要检查输出浏览器或设备方面的小建议。在代码中检查您正在使用的属性/标记。许多属性受Chrome支持但不受Firefox支持,还有许多属性受Firefox支持但不受Safari支持。许多属性在HTML5等中被终止。每个浏览器都有自己的方法来绕过缺少的属性。这样,你会感到困惑。在测试阶段进行浏览器/设备检查。谢谢提示。实际上,我在html标签中包含了css(与布局相关),并且我能够找到为什么只有firefox(根本原因)的答案。我使用了基本设计,这是其他浏览器所接受的。
td {vertical-align:top;}