- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
你好,你会看到蓝色的 flex box 不是 flex 任何解决方案
index.html
<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
JSX 部分它只包含 4 个 div
var Hello = React.createClass({
render: function() {
return <div className = "wrapper" >
< div className = "nav" >deneme < /div>
< div className = "main" >
<div className="dene">
<h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam efficitur semper turpis, id mattis magna tempus nec. Nunc arcu justo, tristique ut tortor et, commodo elementum dui. Duis odio quam, placerat et justo scelerisque, egestas imperdiet ipsum. In at dolor elit. Mauris eu ex fermentum velit feugiat tempus. Curabitur nec turpis ac leo hendrerit rhoncus id eget ante. Ut vel ante vestibulum elit tempor dapibus. Curabitur vitae elementum magna. Ut ut pellentesque dui, eget aliquet mi. Phasellus tincidunt rhoncus urna et elementum. Fusce hendrerit viverra placerat. Vestibulum placerat fringilla ornare. Donec ligula ligula, fermentum et ipsum at, euismod imperdiet tellus. Donec non nibh magna. Cras eu elit et orci posuere pellentesque ac vel leo.</h1>
</div>
< /div> < /div>;
}
});
ReactDOM.render( < Hello / > ,
document.getElementById('container')
);
CSS文档文件一定是这里有问题
.wrapper,
html,
body {
height: 100%;
margin: 0;
}
#container{
display:flex;
height:100%;
margin:0;
}
.wrapper {
display: flex;
flex-direction: column;
flex:1
}
.nav {
background-color: red;
flex: 1
}
.dene{
display:flex;
flex:1;
justify-content: center;
text-align: center;
align-items: center;
margin:auto 40%;
}
.main {
display:flex;
background-color: blue;
flex: 10;
}
这是蓝色区域的结果
最佳答案
在container
规则中将height
更改为min-height
,它会随内容增长
#container{
display:flex;
min-height:100%;
margin:0;
}
当给元素一个 height
时,它会保持那个高度而不考虑它的内容,当内容超过高度时它会简单地溢出元素,这就是本例中发生的情况。
使用 min-height
将允许元素随其内容一起增长,其中 min-
是 be minimum this height 的缩写
关于html - React 和 flexbox 谁能看看这个问题? flex in flex 报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44870945/
#include int main () { char name[20]; printf("Type your name please: "); fgets(name,20,
我有一个使用 new Regex(string pattern) 构造函数创建的 Regex 对象,之后有没有办法查看创建该 regex 对象的模式? 我似乎无法访问 Regex 或 RegexOpt
我从 C 开始,我必须检查 main 函数的参数是否为 double。我正在尝试使用 strtod,但它给我带来了一些麻烦。所以我的主要看起来像这样: int main (int argc,
假设我有: 如何检查 $('.outer') 是否有一个 div,其中包含名为“bar”的类? 最佳答案 使用:has选择器。 $('.outer:has(.bar)') jsFiddle .
花点时间看看这个 fiddle 。此处,Container1 和 Container2 具有背景色:#ccc 和 h1,而 .logo div 具有边距。左右边距工作正常。为什么 Margin-Top
试试这个: template class Base { public: int someBaseMember;
在我获取远程数据 (git-fetch) 之后,git 足够友好地告诉我每个分支上的 SHA,old..new,但是如果我在控制台工作了很多,我可能会失去它们。 如何再次显示它们? 当然我可以将输出保
我在 Wordpress 平台上构建了一个带有水平菜单的网站。 在 ie 9+ 和 firefox 中查看时似乎没问题,但在 ie8- 上菜单 css 类似乎不正确。 我正在使用 firebug 努力
是否可以查看该类型实现了哪些类型类?像这样的东西: >:typeclasses Int [Num, etc...] 最佳答案 使用:info命令。 Prelude> :info Int data In
我正在使用Windows功能CreateToolhelp32snapshot枚举我的机器上正在运行的进程。 pe32.szeFileName它返回的字段是 WCHAR ,这是可执行文件的名称。 我想将
我编写了一个函数,它接受一些参数,并在函数内部使用一个类,该类具有来自第三方库的函数,该函数返回一个 promise ,并且我在自己的函数中返回该 promise 的结果。像: return clie
在 R 中,可以指定一个公式: F <- as.formula('X ~ 1') 我正在尝试想出一种方法来测试上面的 F 是否仅包含截取,即 ~1。我试图使用 grepl 无济于事。有没有办法确定上面
我是一名优秀的程序员,十分优秀!