gpt4 book ai didi

css - 如何允许在网页中水平滚动

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

我打算显示一个宽度较大的表格,所以我还没有创建一个CSS或HTML代码来显示这个表格并且可以水平移动

enter image description here

唯一应该水平滚动的部分在中心(白色)。这是我的默认 Razor View 。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left">
<p class="site-title">@Html.ActionLink("MS. GARCIA MATH 7TH", "Index", "Home")</p>
</div>
<div class="float-right">
<section id="login">
@Html.Partial("_LoginPartial")
</section>
<nav>...</nav>
</div>
</div>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
<footer>
...
</footer>

@Scripts.Render("~/bundles/otf")

@RenderSection("scripts", required: false)
</body>
</html>

最佳答案

设置溢出滚动

#body{
overflow-x: scroll;
}

关于css - 如何允许在网页中水平滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15583467/

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