gpt4 book ai didi

css - 一列空间太大

转载 作者:行者123 更新时间:2023-11-28 07:45:58 25 4
gpt4 key购买 nike

我使用 twitter bootstrap 3。我创建了一个 2 栏页面。

<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="col-sm-2 column menu_side">
left ...
</div>
</div>
<div id="main" class="col-sm-10 column">
right....
</div>
</div>

too much space for the left column

如您所见,左侧部分占用了很多空间。我希望能够比文本大小多一点。

我试图减少到 col-sm1,但文本分成两行。

是否有解决此问题的技术?

最佳答案

在使用 HTML 时,我发现如果使用 CSS,则可以指定 <div> 的宽度和高度。标签。为此,您将在同一文件或单独的 .css 样式页面上创建一段代码以太。

如果您选择将代码放在同一页面上,您将在<head> </head> 之间添加以下代码。标签:

<style type="text/css">
div {
width: (xxx)px;
//replace the (xxx) with the size of the container you would like to have in pixels (or you can replace the pixel number with a percentage)
}
</style>

或者,您可以创建一个新的 .css 文件,其中包含以下代码:

@charset "utf-*";
div {
width: (xxx)px;
// again you would replace the (xxx) with the number of pixels you want the width to be or replace the (xxx)px with the percentage of the page you want the container to take up
}

如果您选择使用单独的 CSS 文件,您可以将以下代码添加到 <head> </head> 之间您要修改的页面上的标签:

<link href="styles.css" rel="stylesheet">

您可以将“styles.css”替换为您命名的 .css 文件

希望这对我有帮助,因为我之前没有使用过 bootstrap

关于css - 一列空间太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30688565/

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