Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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 CSS3 flex属性不工作?_Html_Css_Layout_Flexbox - Fatal编程技术网

Html CSS3 flex属性不工作?

Html CSS3 flex属性不工作?,html,css,layout,flexbox,Html,Css,Layout,Flexbox,我很难理解2009年推出的新flex型号 有三个语法变化,对吗? 我一直在读这个教程,我认为它是最新的。 它在chrome上看起来不错,但在firefox上似乎不起作用。 这个概念很简单,我有一个内容框,里面有三篇文章,一篇文章左边有一幅图片,其中一篇主要内容(细节)居中,中间灵活,右边有一个概览窗格。 如果我理解正确的话,这个CSS文件应该水平地排列它们,同时扩展细节框。 Netbeans告诉我“flex:1”是一个未知属性。我做错了什么 #content { /*Eigenlijke te

我很难理解2009年推出的新flex型号

有三个语法变化,对吗? 我一直在读这个教程,我认为它是最新的。

它在chrome上看起来不错,但在firefox上似乎不起作用。 这个概念很简单,我有一个内容框,里面有三篇文章,一篇文章左边有一幅图片,其中一篇主要内容(细节)居中,中间灵活,右边有一个概览窗格。

如果我理解正确的话,这个CSS文件应该水平地排列它们,同时扩展细节框。 Netbeans告诉我“flex:1”是一个未知属性。我做错了什么

#content { /*Eigenlijke tekst/artikels*/
    /* Oude chome, Android, Opera, IOS & safari syntax */
    display: -webkit-box;
    -webkit-box-orient: horizontal;

    /* Oude firefox syntax */
    display: -moz-box;
    -moz-box-orient: horizontal;

    /* Microsoft moet weer speciaal doen (IE) */
    display: -ms-flexbox;
    -ms-flex-orient: horizontal;

    /* Nieuwe chome syntax */
    display: -webkit-flex;
    -webkit-flex-direction: row;

    /* Nieuwste syntax */
    display: flex;
}

article {
    border: 1px solid black;
}
article[id="picture"] {
    width: 150px;
    padding: 10px;
    margin-left: -20px;
}
#content > article[id="details"] {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    margin-left: 10px;
    margin-right: 10px;
    padding: 10px;
}
article[id="overview"] {
    width: 225px;
    padding: 10px;
}
这是HTML语法:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
        <!--<![endif]-->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <link rel="stylesheet" href="css/detailpages.css">
        <jsp:useBean id="al" scope="application" class="beans.actionlisteners" />
        <script src="js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <div id="page_wrapper">
            <jsp:include page="header.jsp" />
            <jsp:include page="navigation.jsp" />
            <div id="content_wrapper">
                <section id="content">
                    <article id="foto">
                        <img src="img/festivals/rock_werchter_2013.png"
                             alt="Rock Werchter 2013 - afbeelding" width="140px"
                             draggable="true" ondragstart="<% al.dragstart(); %>"
                             />
                        Foto:&nbsp;&nbsp;
                    </article>
                    <article id="details">
                        <header>
                            <h2>Header van details</h2>
                        </header>
                            <p>Gegevens van festival</p>
                        <footer>
                            <h3>footer van details</h3>
                        </footer>
                    </article>
                    <article id="overzicht">
                        <header>
                            <h2>Lijsten</h2>
                        </header>
                            <p>Festivallijst & toevoegen</p>
                        <footer>
                            <h3>borderfactory dinges</h3>
                        </footer>
                    </article>
                </section>
            </div>
            <hr style="width: auto; margin-left: 20px; margin-right: 20px;" />
            <jsp:include page="footer.jsp" />
        </div>
    </body>
</html>

JSP页面
"
/>
福托:
车头货车详情
格格芬节

尾车详细信息 利斯特恩 节日酒店

边境工厂

Firefox实现符合2009规范(
display:box
)有很多问题。当一个元素变成flex容器时,相对于周围的元素,它的行为应该像块元素。Firefox实现更像是一个表元素,因为它缩小到其子元素的大小。添加一个显式宽度通常可以做到这一点:

#content {
  width: 100%;
}

请同时提供HTML。Flex是一个有效的属性,如果Netbeans说它无效,它可能需要更新。嘿@cimmanon,我按照你的要求添加了HTML。顺便说一下,Netbeans说什么或做什么并不重要?我在浏览器内部和Netbeans范围之外测试我的网站,还是我错了?不,很多软件都不这么做o警告您,它无法识别您正在使用的代码。在这种情况下,它只是没有意识到相对较新的属性。是的,我也这么认为;)关于这个问题有什么想法吗?这个主题似乎没有得到太多关注(目前)。这给了我一个不同的结果。我必须为详细信息文章设置最大宽度,因为当我定义宽度时,chrome超过了最大宽度:(我需要更多的信息来进行调整: