html – asp mvc默认应用程序生成删除空格

html – asp mvc默认应用程序生成删除空格,第1张

概述因此,当mvc项目生成时,它有默认的母版页和部分视图,如注册视图和登录视图.问题是母版页在页面左侧和右侧都有默认的空格.我是问题是:写的边距空间代码在哪里以及如何删除它?它看起来很简单我似乎无法找到它. Site.css保留其默认值: body { padding-top: 50px; padding-bottom: 20px;}/* Set padding to keep 因此,当mvc项目生成时,它有默认的母版页和部分视图,如注册视图和登录视图.问题是母版页在页面左侧和右侧都有默认的空格.我是问题是:写的边距空间代码在哪里以及如何删除它?它看起来很简单我似乎无法找到它.

Site.CSS保留其默认值:

body {    padding-top: 50px;    padding-bottom: 20px;}/* Set padding to keep content from hitting the edges */.body-content {    padding-left: 15px;    padding-right: 15px;}/* OverrIDe the default bootstrap behavior where horizontal description Lists    will truncate terms that are too long to fit in the left column */.dl-horizontal dt {    white-space: normal;}/* Set wIDth on the form input elements since they're 100% wIDe by default */input,select,textarea {    max-wIDth: 280px;}

而且我的indes.csHTML非常简单:

@{    VIEwBag.Title = "Home Page";}<div ID="mapa">    <h1>ASP.NET</h1></div><div ID="content">    <div >        <nav >            <div >                <div >                    <a  href="#">WebSitename</a>                </div>                <ul >                    <li ><a href="#">Home</a></li>                    <li><a href="#">Page 1</a></li>                    <li><a href="#">Page 2</a></li>                    <li><a href="#">Page 3</a></li>                </ul>            </div>        </nav>    </div>    </div>

我尝试将margin-left:0和margin-right:0添加到body-content类,但它只是将子页面向左移动并保持其大小.

解决方法 空白是因为默认情况下,通过Visual Studio创建的ASP.NET MVC项目使用 Bootstrap CSS Framework.我建议您学会使用它 – 它将使您的前端开发量更容易.

解决你的问题,你会发现任何一方带有“空白”的内容都嵌套在一个包含类容器的div中.删除此类并使用container-fluID将删除空白并使容器成为全屏宽度.

不要试图通过bootstrap覆盖容器上设置的边距,否则会破坏bootstrap在其他地方的样式.

总结

以上是内存溢出为你收集整理的html – asp mvc默认应用程序生成删除空格全部内容,希望文章能够帮你解决html – asp mvc默认应用程序生成删除空格所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1045556.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存