MVC中的布局在页面顶部留下空白区域

时间:2017-08-30 13:38:39

标签: html css asp.net-mvc layout

大家好,我希望有人可以帮助我,我有一个小问题,但不知道如何解决它我已逐行检查并idd一些更改,但仍然无法修复它,我有以下代码的MVC中的布局:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@ViewBag.Title - Mi aplicación ASP.NET</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">


    <script src="~Scripts/jquery-3.2.1.min.js"></script>

    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="~/Content/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="~/Content/bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="~/Content/bower_components/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="~/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="~/dist/css/skins/_all-skins.min.css">
    <!-- Morris chart -->
    <link rel="stylesheet" href="~/Content/bower_components/morris.js/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="~/Content/bower_components/jvectormap/jquery-jvectormap.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="~/Content/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="~/Content/bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="~/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

    <!-- HTML5 Shim and Respond.js 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]-->
    <!-- Google Font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body id="elementoboy" runat="server" class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">

        <header class="main-header">
            <!-- Logo -->
            <a href="~/index2.html" class="logo">
                <!-- mini logo for sidebar mini 50x50 pixels -->
                <span class="logo-mini"><b></b></span>
                <!-- logo for regular state and mobile devices -->
                <span class="logo-lg"><b>Hola</b>Staff</span>
            </a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top">
                <!-- Sidebar toggle button-->
                <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                    <span class="sr-only">Toggle navigation</span>
                </a>

                <div class="navbar-custom-menu">
                    <ul class="nav navbar-nav">
                        <!-- User Account: style can be found in dropdown.less -->
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <img src="~/dist/img/holastaffpicture.jpg" class="user-image" alt="User Image">
                                <span class="hidden-xs"><asp:Label runat="server" ID="lblnombreususario2"></asp:Label></span>

                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header">
                                    <img src="~/dist/img/holastaffpicture.jpg" class="img-circle" alt="User Image">

                                    <p>
                                    <p><asp:Label runat="server" ID="lblnombreusuario3"></asp:Label></p>

                                    </p>
                                </li>
                                <!-- Menu Body -->

                                    <li class="user-body">


                                        <div class="row">

                                            <div class="col-xs-15 text-center">

                                                <button type="button" onclick="location.href='@Url.Action("CerrarSession", "Home")'"/>
                                                </div>


                                        </div>

                                        <!-- /.row -->
                                    </li>


                                <!-- Menu Footer-->

                                <li class="user-footer">

                                    <div class="pull-left">





                                    </div>


                                </li>



                            </ul>
                        </li>
                        <!-- Control Sidebar Toggle Button -->
                    </ul>
                </div>
            </nav>
        </header>
        <!-- Left side column. contains the logo and sidebar -->
        <aside class="main-sidebar">
            <!-- sidebar: style can be found in sidebar.less -->
            <section class="sidebar">
                <!-- Sidebar user panel -->
                <div class="user-panel" style="height:auto">
                    <div class="pull-left image">
                        <img style="width:auto" src="~/dist/img/holastaffpicture.jpg" class="img-circle" alt="User Image">
                    </div>
                    <div class="pull-left info">

                        <p><asp:Label runat="server" ID="lblnombreusuario"></asp:Label></p>
                        <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                    </div>
                </div>
                <!-- search form -->
                <!-- /.search form -->
                <!-- sidebar menu: : style can be found in sidebar.less -->

                <ul class="sidebar-menu" data-widget="tree">
                    <li><a href="/Home/Login"><i class="fa fa-address-card"></i> <span>LoginAdministradores</span></a></li>
                    <li><a href="/Home/GoToVistaEmpleador"><i class="fa fa-institution"></i> <span>Reporte Empleador</span></a></li>
                    <li><a href="/Home/GoToVistaCandidato"><i class="fa fa-child"></i> <span>Reporte Candidato</span></a></li>
                    <li><a href="/Home/GoToVistaVacantes"><i class="fa fa-bullhorn"></i> <span>Reporte Vacantes</span></a></li>
                    <li><button type="button" class="btn btn-info" style="width:100px" onclick="location.href='@Url.Action("CerrarSession", "Home")'" />Cerrar Sesion</li>




                </ul>
            </section>
            <!-- /.sidebar -->
        </aside>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    <asp:ContentPlaceHolder ID="head" runat="server">
                    </asp:ContentPlaceHolder>
                </h1>
            </section>

            <!-- Main content -->
            <section class="content">
                <div class="row">
                    <div class="col-sm-12">
                        <asp:ContentPlaceHolder ID="CPH1" runat="server">

                            <div class="container body-content">
                                @RenderBody()
                                <hr />
                                <footer>
                                    <p>&copy; @DateTime.Now.Year - Reporting HolaStaff</p>
                                </footer>
                            </div>



                        </asp:ContentPlaceHolder>
                    </div>
                </div>

            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <footer class="main-footer">
            <div class="pull-right hidden-xs">
                <b>Version</b> 2.4.0
            </div>
            <strong>Copyright &copy;<a href="https://holastaff.mx">HolaStaff</a>.</strong> All rights
            reserved.
        </footer>

        <!-- Control Sidebar -->
        <!-- /.control-sidebar -->
        <!-- Add the sidebar's background. This div must be placed
             immediately after the control sidebar -->
        <div class="control-sidebar-bg"></div>
    </div>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
    <!-- ./wrapper -->
    <!-- jQuery 3 -->
    <script src="~/Content/bower_components/jquery/dist/jquery.min.js"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="~/Content/bower_components/jquery-ui/jquery-ui.min.js"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.7 -->
    <script src="~/Content/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- Morris.js charts -->
    <script src="~/Content/bower_components/raphael/raphael.min.js"></script>
    <script src="~/Content/bower_components/morris.js/morris.min.js"></script>
    <!-- Sparkline -->
    <script src="~/Content/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
    <!-- jvectormap -->
    <script src="~/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
    <script src="~/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
    <!-- jQuery Knob Chart -->
    <script src="~/Content/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
    <!-- daterangepicker -->
    <script src="~/Content/bower_components/moment/min/moment.min.js"></script>
    <script src="~/Content/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
    <!-- datepicker -->
    <script src="~/Content/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="~/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
    <!-- Slimscroll -->
    <script src="~/Content/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="~/Content/bower_components/fastclick/lib/fastclick.js"></script>
    <!-- AdminLTE App -->
    <script src="~/dist/js/adminlte.min.js"></script>
    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
    <script src="~/dist/js/pages/dashboard.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="~/dist/js/demo.js"></script>
</body>
</html>

问题是它在页面顶部留下了一个很大的空白区域,请看这张图片 imglayout

正如您在图片中看到的那样,我的布局有一个很大的空白区域和页面顶部,我该如何解决?我希望删除该空白区域并使布局完全修复所有屏幕,提前感谢

1 个答案:

答案 0 :(得分:3)

我通过在body标签=)

中添加style="padding-top:unset; padding-bottom:unset"来解决它
<body id="elementoboy" runat="server" style="padding-top:unset; padding-bottom:unset"  class="hold-transition skin-blue sidebar-mini">