gpt4 book ai didi

css - 奇怪的行为 : Why is container height changed by bootstrap columns?

转载 作者:行者123 更新时间:2023-11-28 17:37:56 24 4
gpt4 key购买 nike

请参阅此 plnkr:http://plnkr.co/edit/wun8TRdaJoaJTCC4DJ0Q

<html>

<head>
<script data-require="jquery@*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script data-require="bootstrap@3.1.1" data-semver="3.1.1" src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link data-require="bootstrap-css@3.1.1" data-semver="3.1.1" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
</head>

<body>
<div class="container">
<div class="intro">
<div class="content">
<h1>
should be green
</h1>
<div class="col-xs-12">
should be green, why am I blue?
</div>
</div>
<div class="mask">
should be blue
</div>
</div>
</div>
</body>

</html>

最佳答案

每当您使用任何列类(col-xs-12 或 col-md-6 或任何东西)时,您都必须用 <div class="row"></div> 将该类括起来。 .这将清除您的 float 。这就是 Bootstrap 的框架。每次使用“col-*”类时,都必须从“row”类开始。

    <div class="container">
<div class="intro">
<div class="content">
<h1>
should be green
</h1>
<div class="row">
<div class="col-xs-12" style="">
should be green, why am I blue?
</div>
</div>
</div>
<div class="mask">
should be blue
</div>
</div>
</div>

关于css - 奇怪的行为 : Why is container height changed by bootstrap columns?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24749091/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com