html - Semantic-UI - 如何设置百分比大小

标签 html css twitter-bootstrap semantic-ui

几天前我发现了semantic-ui,我必须说它令人印象深刻,我现在正在尝试将我的应用程序从Bootstrap 3转换为semantic-ui。

这里需要一点帮助,我想做的是将页面主体分为两部分。我想要 2 个 div 的高度,以 % 表示。 85%和15%,使其成为完整的100%。但由于某种原因它不起作用。

body {
height: 100%;
width: 100%;
}
#div1 {
height: 85% !important;
border: 1px solid #000000;
}
#div2 {
height: 15% !important;
}

我做错了什么吗?这在 Bootstrap 中有效。 有人可以解释一下吗?

提前致谢, 普拉尼

最佳答案

语义 IU 网格系统示例。

<div class="ui stackable grid">
<div class="equal height row">
    <div class="twelve wide column">

            <p>Your question was asking about vertical percentages, but here is an example of how the grid system of Semantic UI can have equal height rows so that a busy column like this one is the same height as others in the same row allowing for a div below  without overlaps. This area is three quarters wide (twelve blocks out of sixteen). It is whatever height the content is. </p> 

    </div>
    <div class="four wide column">

           <p>The small column</p>

    </div>
</div>

<div class="row">
    <div class="sixteen wide column">
        <div class="ui segment"> 
             <p> This is the footer in a box because it is wrapped in a div with a class name "ui segment". </p>
        </div>
    </div>
</div>

删除“可堆叠”一词以阻止布局响应。 在第一个列表中添加“页面”一词以修复大屏幕上的最大宽度。

关于html - Semantic-UI - 如何设置百分比大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21334364/

相关文章:

css - 是否可以在不 float 的情况下并排显示 div?

html - 如何将基于百分比的宽度(相对于元素位置)设置为表格单元格内的绝对定位元素?

html - hover div的高度在增加

google-chrome - 带有溢出的奇怪 CSS 行为?

django - Twitter Bootstrap的Django错误样式

jquery - 表单重置导致 jquery.validation 出现 "out of stack space"错误

html - 我的 ASP.NET 桌面网站布局无法在移动设备上正确显示

html - 将表单操作值设置为 url

jquery - 最终定价 jQuery 脚本

CSS 渐变(悬停)无法正常工作