Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/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
CSS流体网格-div高度不小于';不能调整_Css_Layout_Fluid - Fatal编程技术网

CSS流体网格-div高度不小于';不能调整

CSS流体网格-div高度不小于';不能调整,css,layout,fluid,Css,Layout,Fluid,我正在使用下面的流体网格系统 /* SECTIONS */ .section { clear: both; padding: 0px; margin: 0px; } /* COLUMN SETUP */ .col { display: block; float:left; margin: 1% 0 1% 1.6%; } .col:first-child { margin-left: 0; } /* GROUPING */ .grou

我正在使用下面的流体网格系统

/*  SECTIONS  */
.section {
    clear: both;
    padding: 0px;
    margin: 0px;
}

/*  COLUMN SETUP  */
.col {
    display: block;
    float:left;
    margin: 1% 0 1% 1.6%;
}
.col:first-child { margin-left: 0; }

/*  GROUPING  */
.group:before,
.group:after { content:""; display:table; }
.group:after { clear:both;}
.group { zoom:1; /* For IE 6/7 */ }

/*  GRID OF TWELVE  */
.span_12_of_12 {
    width: 100%;
}

.span_11_of_12 {
    width: 91.53%;
}
.span_10_of_12 {
    width: 83.06%;
}

.span_9_of_12 {
    width: 74.6%;
}

.span_8_of_12 {
    width: 66.13%;
}

.span_7_of_12 {
    width: 57.66%;
}

.span_6_of_12 {
    width: 49.2%;
}

.span_5_of_12 {
    width: 40.73%;
}

.span_4_of_12 {
    width: 32.26%;
}

.span_3_of_12 {
    width: 23.8%;
}

.span_2_of_12 {
    width: 15.33%;
}

.span_1_of_12 {
    width: 6.866%;
}
我想要创建一个按钮,我想要高度像宽度一样收缩/扩展。我还希望高度是父div的一部分,并垂直对齐。以下是html:

<header class="section group header">
        <img class="col span_8_of_12" src="img/logo.png">
        <div class="col span_1_of_12">

        </div>
        <div class="col span_3_of_12 call-to-action">
            <a href="offer.html">Get An Offer</a> 
        </div>
</header>

.calltoaction{height:30%;margintop:20%;}
什么都不做。高度仅适用于像素。边距顶部不能作为像素或百分比使用

我觉得应该有一个CSS解决方案。我希望所有元素都能按比例调整-高度和宽度。流体网格似乎只调整宽度

谢谢你的意见


“获取报价”按钮的高度不会扩大。此外,我希望“获取报价”按钮与徽标中的文字保持一致。徽标尺寸随着流体宽度的增加而增加,这意味着按钮顶部的边距也必须调整。

你可以附上你想要的图片吗?顺便说一句,我想你可以很好地回答我在上面添加的图片我看到了链接。Javascript是唯一的方法吗?为什么不使用px来缩放高度并在不同的屏幕上更改px?甚至为什么不使用bootstrap之类的css框架?如果你想按%(百分比)缩放高度,我应该说“位置:相对”是不可能的;它只适用于“固定”或“绝对”位置,你可以测试“高度:100vh”但是我自己不这么做。那么唯一的办法就是在你的案例中使用javascript