Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap with ASP.net not using full screen

Can anyone point out why my navbar (I have more stuff but same problem) is not fully using my screen when in full screen? Not sure If i need to use class col but from other examples I do not see people having to use this for their nav bar. Not sure if it has something to do with the asp form or not. First time using bootstrap.

Screenshot

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin.aspx.cs" Inherits="SCBA.admin" %>
    <!DOCTYPE html>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Admin</title>
        <link href="../Content/bootstrap.min.css" rel="stylesheet" />
        <link href="stylesheet3.css"  type="text/css" rel="stylesheet"/>

    </head>
    <body>
        <form id="form1" runat="server">
            <div class="container">
                <div class="navbar navbar-default">
                    <div class ="container-fluid">
                     <div class="navbar-header">
                            <asp:Button ID="btnadministration" runat="server" cssClass="button1" onclick="btnadministration_Click" Text="Administration" /> 
                             <br>
                            <asp:Button ID="btnresource" runat="server" cssClass="button1" onclick="btnresource_Click" Text="Resource" />  
                     </div>
                     <div class="navbar-right">
                            <asp:Button ID="btnlogout" runat="server" cssClass="button1" onclick="btnlogout_Click" Text="Logout" />  
                     </div>  
                     <div class="header1">Tracking System</div>
                     <div class="header2">Admin View-Super Admin</div>  
                      </div>                          
                 </div> 
             </div>      
      </form>
        <script src="../Scripts/jquery.min.js"></script>
        <script src="../Scripts/boostrap.min.js"></script>
    </body>
    </html>
like image 589
T Dang Avatar asked Mar 07 '26 22:03

T Dang


1 Answers

use class container-fluid instead of container in the first div

container has a fixed width which is used in larger screen but container-fluid has no fixed width, so it takes the full width of the body

like image 160
Chiller Avatar answered Mar 09 '26 16:03

Chiller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!