- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要将 2 个子容器“左”和“右”设为 100% 高度,因为父容器“”已经存在 - 这怎么可能?我如何管理一个适当的水平放置的容器“hexCont”?
CSS:
<style type="text/css">
html, body {
margin: 0px;
padding: 0px;
height: 100%;
}
#makkq {
min-height: 100%;
height: auto !important;
background-color: #ECE2C6;
height: 100%;
}
#makkq .left {
display:table;
float:left;
min-width:290px;
width:50%;
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto;
text-align:center;
background-color: #fff;
outline:1px solid #C9C9C9;
}
#makkq .right {
display:table;
float:right;
min-width:289px;
width:50%;
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto;
text-align:center;
background-color: #f8f8f8;
outline:1px solid #C9C9C9;
}
#makkq .inner {
display: table-cell;
vertical-align: middle;
padding:20px;
}
#makkq .innerTitleLft, #makkq .innerTitleRght {
width:100%;
font-size:24px;
font-weight:300;
color: #494949;
padding:15px 0;
}
#makkq .decisionLabel {
width:60px;
height:22px;
background-color: #494949;
color:#fff;
position:absolute;
text-align:center;
left:470px;
margin-top:90px;
padding-top:3px;
}
#makkq .hexContOuter {
position: relative;
}
#makkq .hexCont {
position: absolute;
margin-top:80px;
left:50%;
transform: translate(-50%, -50%);
text-align:center;
}
#makkq .hexagon {
color:white;
position: relative;
width: 60px;
height: 22px;
background-color: #494949;
margin: 50px;
}
#makkq .hexagon:before, .hexagon:after {
content:" ";
position: absolute;
border-top: 11px solid transparent;
border-bottom: 11px solid transparent;
}
#makkq .hexagon:before {
left: 100%;
border-left: 11px solid #494949;
}
#makkq .hexagon:after {
right: 100%;
border-right: 11px solid #494949;
}
#makkq .hexagonTxt {
font-size:12px;
display:inline-block;
padding-top:1px;
}
#makkq .innerTxt {
width:100%;
font-size:12px;
line-height:16px !important;
font-weight:400;
color: #494949;
margin-bottom:35px;
}
</style>
HTML:
<div id="makkq">
<div class="hexContOuter">
<div class="hexCont">
<div class="hexagon">
<span class="hexagonTxt">or</span>
</div>
</div>
</div>
<div class="left">
<div class="inner">
<div class="innerTitleLft">Lorem Ipsum Left</div>
<div class="innerTxt">lorem ipsum dolor sit lorem ipsum dolor sit lorem ipsum dolor sit</div>
</div>
</div>
<div class="right">
<div class="inner">
<div class="innerTitleRght">Lorem Ipsum Right</span></div>
<div class="innerTxt">lorem ipsum dolor sit lorem ipsum dolor sit lorem ipsum dolor sit</div>
</div>
</div>
</div>
最佳答案
从容器 (#makkq
)、左 (#makkq .left
) 和右 (#makkq .right
) 内容。此外,当您在元素上设置了 height: 100%;
时,无需分配 min-height: 100%;
。
更新的 CSS:
#makkq {
/* min-height: 100%;
height: auto !important; */
background-color: #ECE2C6;
height: 100%;
}
#makkq .left {
display: table;
float: left;
min-width: 250px;
width: 50%;
/* min-height: 100%;
height: auto !important; */
height: 100%;
margin: 0 auto;
text-align: center;
background-color: #fff;
outline: 1px solid #C9C9C9;
}
#makkq .right {
display: table;
float: right;
min-width: 250px;
width: 50%;
/*min-height: 100%;
height: auto !important;*/
height: 100%;
margin: 0 auto;
text-align: center;
background-color: #f8f8f8;
outline: 1px solid #C9C9C9;
}
关于子容器的 CSS 全高?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30365915/
我想做一个模板 页眉+侧边栏(半页/全高)+谷歌地图(半页/全高) 在 jsfiddle 中,很难看到细节,但在浏览器的一侧给我一个我不想要的滚动条。此外,侧边栏比预期高 40 像素(标题的高度)。而
我有一张背景图片,我想在我的网站上使用它,但问题是我无法将其制作成任何尺寸的全高和全宽,请帮助我,请检查下面的代码 当前代码,代码 #1:haft 而不是 full body { backgr
我想在网站中放置一个图像作为背景,我希望该图像具有响应性,但页脚始终位于底部,以便图像调整大小此外,我希望在宽度上被“切断”。我举三个例子。 示例 # 1:以 16:9 浏览网页 http://i.s
我需要将 2 个子容器“左”和“右”设为 100% 高度,因为父容器“”已经存在 - 这怎么可能?我如何管理一个适当的水平放置的容器“hexCont”? CSS: html, body {
我已经开始学习 angular 2 Material ,这很令人困惑,因为我在文档和官方中找不到很多东西 material.io css 是根据类编写的,而 Angular Material 使用“类
我继承了一个 iOS 应用程序,但我发现没有使用全高。这是 iPhone 6 上的照片: 它似乎卡在了 iPhone 4 的分辨率上。 iOS 部署目标:7.1 有什么想法可以让整个应用的高度适合全屏
我有以下 HTML 来构建一个 900 像素宽的居中页面,其中包含页眉、页脚和内容部分:
我创建了一个简单的网站,每隔几秒钟就会更改一次图像。所有图像均为横向。当我的浏览器处于正常 View 模式时,图像覆盖浏览器的整个高度,但是当我将浏览器更改为全屏模式时,图像并没有覆盖浏览器的整个高度
我使用以下代码来显示全高的 div(具有背景颜色)。 HTML here is a lot of text....
在我的网页设计中获取父 div 的完整高度时遇到了一些麻烦。容器div是一个div内的div,高度为100%。 我已经尝试阅读关于 stackoverflow 和其他人的一些其
我试图使用此 CSS 使标题填满屏幕: position:relative; margin:0; padding:0; width:100%; height:100%; min-height:100%
我目前正在尝试实现以下场景: 我正在使用以下 HTML 和 CSS 代码。 ( See JSFiddle for example ) HTML:
我知道类似的问题已经被问过很多次,但我尝试了很多答案,但似乎没有一个适合我的情况。我找到了很多针对粘性页脚的解决方案,但这并不是我想要的,或者我还没有想出如何根据我的情况正确使用: 我有完全固定的位置
我正在通过 Bootstrap 制作左侧,并且在设置我的内部元素固定位置时遇到这个问题。 这是我的HTML
我对简单的 html/css 技巧有疑问。 我想创建左栏高度为 100% 的网站,例如宽度 300px,在右侧我想要 contener div 和其余的宽度。 下面的代码: html {min-hei
我正在开发一个当前配置为全高(即 100% 可用浏览器窗口)应用程序的新网站。在布局方面,它是这样的 - http://stevesanderson.github.com/fixed-height-l
让 div 始终保持 100% 高度的诀窍是什么,即使用户正在滚动也是如此? 我试过了,但没有成功,因为高度只应用于事件窗口。 [...] ... .popup_contai
正如标题所说。我想插入一个延伸到窗口末尾的 FB 页面提要。这可能吗?当我在 iframe 上设置它时,我认为 800px 是它想要达到的最高值。我到处寻找答案,但没有成功。 我用过 Facebook
我正在制作一个具有固定导航栏、全屏背景和中间文本的页面。而且我不知道如何让它在横向模式下响应。在其他版本上,它表现正常,但在横向上,因为我认为高度要小得多,所以文本与导航栏重叠。而且看起来真的很乱。
我想做的是: 创建一个全高 div,滚动后转到固定的顶部 div。 1) ----------- | | | | | | |--
我是一名优秀的程序员,十分优秀!