Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.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
Twitter bootstrap col中的Div未应用css属性?_Twitter Bootstrap - Fatal编程技术网

Twitter bootstrap col中的Div未应用css属性?

Twitter bootstrap col中的Div未应用css属性?,twitter-bootstrap,Twitter Bootstrap,有人能解释一下为什么div映射在col中时没有应用css吗?刚开始启动,在搜索中找不到任何内容 <style> #map { width: 25%; height: 25%; background-color: blue; } </style> </head> <body> <container-fluid>

有人能解释一下为什么div映射在col中时没有应用css吗?刚开始启动,在搜索中找不到任何内容

   <style>
        #map {
            width: 25%;
            height: 25%;
            background-color: blue;
        }
    </style>

</head>
<body>

    <container-fluid>
        <div class="row">
            <div class="col-md-6">
                <div id="map">

                </div>
            </div>
            <div class="col-md-3">10</div>
            <div class="col-md-3">15</div>
        </div>
    </container-fluid>

</body>

除非父对象具有定义的高度,否则不能为高度指定百分比

25%的宽度可以,但您必须提供固定的高度-将其更改为200px,您将看到蓝色区域:


编辑:我还必须将defs列改为xs,而不是md,以便在小的jsfiddle窗口中显示,您不必这样做。我必须更改以使其工作。

尝试以像素为单位给出宽度和高度。另外,我认为应该是这样的,那么是否可以设置柱的高度呢?我需要将div映射设置为100%高度:l@starscream1984您可以将层次结构中的所有内容设置为100%高度,从HTML开始,然后您在map div上的最后100%将生效: