gpt4 book ai didi

HTML:在中间做一列

转载 作者:太空宇宙 更新时间:2023-11-04 13:26:06 24 4
gpt4 key购买 nike

我想制作一个背景固定的网站(我已经有了),在背景前面中间是我的东西,比如这个网站:http://www.nexusmods.com/skyrim/ ?我搜索了整个互联网,但找不到任何东西。我已经在源代码中搜索过。有人能帮我吗?抱歉我的英语不好,我是瑞士人。请随时纠正我。

最佳答案

您正在寻找的是设置主要内容的固定宽度,然后为左右设置自动边距以使其居中。

.content {
width:600px; //set your desire width here
background-color:#ffffaa; // color is just there to visualize
margin-left:auto;
margin-right:auto;
}

在您的 HTML 中:

<body>
<!-- header -->

<!-- main content -->
<div class="content">
This is the main content box
</div>

<!-- footer -->

</body>

希望这会有所帮助。
注册,

关于HTML:在中间做一列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23709740/

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