gpt4 book ai didi

css - 当行单元格中的内容填充不足时,引导容器流体会收缩

转载 作者:太空宇宙 更新时间:2023-11-04 01:33:02 25 4
gpt4 key购买 nike

当行内的单元格为空或内容不足时,页面容器会收缩。

html,
body {
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #f3f3f4;
color: #676a6c;
height: 100%;
}

.box {
border: 1px red dotted;
}

#side-menu {
background-color: #2f4050;
padding: 0px;
}

#side-menu h1 {
color: #1f3647;
text-align: center;
margin: 10px 0px;
font-size: 25px;
}

.display-table {
display: table;
padding: 0px;
height: 100%;
}

.display-table-row {
display: table-row;
height: 100%;
}

.display-table-cell {
display: table-cell;
height: 100%;
float: none;
}

.valign-top {
vertical-align: top;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>

<!-- Bootstrap -->
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/default.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>

<body>

<div class="container-fluid display-table">
<div class="row display-table-row">
<!-- side menu -->
<div class="col-md-2 display-table-cell valign-top" id="side-menu">
<h1>Navigation</h1>
</div>
<!-- main content -->
<div class="col-md-10 display-table-cell valign-top box">
<div class="row">
<header>
<div class="col-md-5">
<input type="text" name="term" placeholder="Search anythhing ...">
</div>
<div class="col-md-7">
<ul>
<li>Welcome to administration area</li>
<li>
<a href="#">
<span class="glyphicon glyphicon-bell" aria-hidden="true"></span>
<span class="label lable-warning">3</span>
</a>
</li>

<li>
<a href="#">
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<span class="label lable-message">3</span>
</a>
</li>

<li>
<a href="#">
<span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Log out
</a>
</li>
</ul>
</div>
</header>
</div>

<div class="row">
<footer>
<div class="pull-left"><b>Copyright</b> &copy; 2017</div>
<div class="pull-right"><b>Admin System</b></div>
</footer>
</div>

</div>
</div>
</div>




<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./bootstrap/js/bootstrap.min.js"></script>
</body>

</html>

如您所见,我正在使用 bootstrap 来构建我的页面。容器类是 <div class="container-fluid display-table">

页面应该是 100% 宽度,但它有左右边距,如下所示:

enter image description here

当我填写 col-md-5我得到的是一些文字: enter image description here

知道为什么会这样吗??

最佳答案

我只需将 width: 100% 添加到表格元素即可完成此操作。

.display-table {width: 100%;}

希望这能解决问题。

关于css - 当行单元格中的内容填充不足时,引导容器流体会收缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46738449/

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