Skip to main content
se añadieron 8466 caracteres en el cuerpo
Origen Enlace
Jheyman Mejia
  • 3.9k
  • 3
  • 26
  • 53

Añado edición con tu código, recuerda quitar el CSS innecesario.

<!DOCTYPE html>
<html lang="en">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>DentalRenew - Gestion de clinicas dentales </title>

  <!-- Custom fonts for this template-->
  <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />

  <!-- Custom styles for this template-->
  <link href="css/sb-admin-2.min.css" rel="stylesheet">
  <link href="css/custom.css" rel="stylesheet">

</head>

<body class="d-flex flex-column min-vh-100">


  <!-- Main Content -->
  <div id="content">

    <!-- Topbar -->
    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
      <a class="navbar-brand" href="#">DentalRenew</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
                      <span class="navbar-toggler-icon"></span>
                    </button>
      <div class="collapse navbar-collapse" id="navbarCollapse">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item dropdown active">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Clientes
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Alta Cliente</a>
              <a class="dropdown-item" href="#">Añadir tratamiento</a>
            </div>
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Citas
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Programar cita</a>
            </div>
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Empleados
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Alta empleado</a>
              <a class="dropdown-item" href="#">Añadir puesto</a>
            </div>
          </li>


          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Facturacion
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Presupuesto</a>
              <a class="dropdown-item" href="#">Estadisticas</a>
            </div>
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Usuarios
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Registrar nuevo usuario</a>
            </div>
          </li>

        </ul>
      </div>
    </nav>
  </div>
  <!-- End of Topbar -->
  <div class="container main">
    <div class="card shadow mb-4 mt-5">
      <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary">Gastos y ingresos</h6>
      </div>
      <div class="card-body">
        <div class="row">
          <canvas id="ingresos"></canvas>
        </div>
      </div>
    </div>

    <div class="card shadow mb-4 mt-5">
      <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary">Nº de empleados</h6>
      </div>
      <div class="card-body">
        <div class="row">
          <canvas id="n_empleados"></canvas>
        </div>
      </div>
    </div>
  </div>
  <!-- End of Main Content -->

  <!-- Footer -->
  <footer class="mt-auto footer bg-dark">
    <div class="copyright text-center text-light my-auto">
      <span>Proyecto - Gestion Clinica dental</span>
    </div>
  </footer>
  <!-- End of Footer -->

  </div>
  <!-- End of Content Wrapper -->

  <!-- Bootstrap core JavaScript-->

  <!-- Custom scripts for all pages-->
  <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  <script src="js/sb-admin-2.min.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  <script src="js/chart.js"></script>

  <script>
    const labels = [
      'Enero',
      'Febrero',
      'Marzo',
      'Abril',
      'Mayo',
      'Junio',
      'Julio',
      'Agosto',
      'Septiembre',
      'Octubre',
      'Noviembre',
      'Diciembre',
    ];

    const data = {
      labels: labels,
      datasets: [{
          label: 'Ingresos',
          backgroundColor: 'rgb(255, 99, 132)',
          borderColor: 'rgb(255, 99, 132)',
          data: [0, 1000, 2000, 3000, 4000, 5000, 6000, 0, 1000, 2000, 3000, 4000, 5000, 6000],
        },
        {
          label: 'Gastos',
          backgroundColor: 'rgb(51, 116, 255)',
          borderColor: 'rgb(51, 116, 255)',
          data: [0, 2000, 2000, 3000, 4000, 5000, 6000, 0, 1000, 2000, 3000, 4000, 5000, 6000],
        }
      ]
    };

    const configIG = {
      type: 'line',
      data: data,
      options: {}
    };

    const myChart = new Chart(
      $('#ingresos').attr('id'),
      configIG
    );


    const numeroEmpleados = new Chart(
      $('#n_empleados').attr('id'),
      configIG
    );
  </script>

</body>

</html>

Añado edición con tu código, recuerda quitar el CSS innecesario.

<!DOCTYPE html>
<html lang="en">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>DentalRenew - Gestion de clinicas dentales </title>

  <!-- Custom fonts for this template-->
  <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />

  <!-- Custom styles for this template-->
  <link href="css/sb-admin-2.min.css" rel="stylesheet">
  <link href="css/custom.css" rel="stylesheet">

</head>

<body class="d-flex flex-column min-vh-100">


  <!-- Main Content -->
  <div id="content">

    <!-- Topbar -->
    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
      <a class="navbar-brand" href="#">DentalRenew</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
                      <span class="navbar-toggler-icon"></span>
                    </button>
      <div class="collapse navbar-collapse" id="navbarCollapse">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item dropdown active">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Clientes
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Alta Cliente</a>
              <a class="dropdown-item" href="#">Añadir tratamiento</a>
            </div>
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Citas
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Programar cita</a>
            </div>
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Empleados
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Alta empleado</a>
              <a class="dropdown-item" href="#">Añadir puesto</a>
            </div>
          </li>


          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Facturacion
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Presupuesto</a>
              <a class="dropdown-item" href="#">Estadisticas</a>
            </div>
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             Usuarios
                            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="#">Listado</a>
              <a class="dropdown-item" href="#">Registrar nuevo usuario</a>
            </div>
          </li>

        </ul>
      </div>
    </nav>
  </div>
  <!-- End of Topbar -->
  <div class="container main">
    <div class="card shadow mb-4 mt-5">
      <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary">Gastos y ingresos</h6>
      </div>
      <div class="card-body">
        <div class="row">
          <canvas id="ingresos"></canvas>
        </div>
      </div>
    </div>

    <div class="card shadow mb-4 mt-5">
      <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary">Nº de empleados</h6>
      </div>
      <div class="card-body">
        <div class="row">
          <canvas id="n_empleados"></canvas>
        </div>
      </div>
    </div>
  </div>
  <!-- End of Main Content -->

  <!-- Footer -->
  <footer class="mt-auto footer bg-dark">
    <div class="copyright text-center text-light my-auto">
      <span>Proyecto - Gestion Clinica dental</span>
    </div>
  </footer>
  <!-- End of Footer -->

  </div>
  <!-- End of Content Wrapper -->

  <!-- Bootstrap core JavaScript-->

  <!-- Custom scripts for all pages-->
  <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  <script src="js/sb-admin-2.min.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  <script src="js/chart.js"></script>

  <script>
    const labels = [
      'Enero',
      'Febrero',
      'Marzo',
      'Abril',
      'Mayo',
      'Junio',
      'Julio',
      'Agosto',
      'Septiembre',
      'Octubre',
      'Noviembre',
      'Diciembre',
    ];

    const data = {
      labels: labels,
      datasets: [{
          label: 'Ingresos',
          backgroundColor: 'rgb(255, 99, 132)',
          borderColor: 'rgb(255, 99, 132)',
          data: [0, 1000, 2000, 3000, 4000, 5000, 6000, 0, 1000, 2000, 3000, 4000, 5000, 6000],
        },
        {
          label: 'Gastos',
          backgroundColor: 'rgb(51, 116, 255)',
          borderColor: 'rgb(51, 116, 255)',
          data: [0, 2000, 2000, 3000, 4000, 5000, 6000, 0, 1000, 2000, 3000, 4000, 5000, 6000],
        }
      ]
    };

    const configIG = {
      type: 'line',
      data: data,
      options: {}
    };

    const myChart = new Chart(
      $('#ingresos').attr('id'),
      configIG
    );


    const numeroEmpleados = new Chart(
      $('#n_empleados').attr('id'),
      configIG
    );
  </script>

</body>

</html>

Origen Enlace
Jheyman Mejia
  • 3.9k
  • 3
  • 26
  • 53

No necesitas CSS adicional, con las clases de Bootstrap bastan.

Como bien te indican en los comentarios, lo primero que debes hacer es darle un alto mínimo a tu <body>, lo consigues con .min-vh-100, adicional puedes hacerlo flexible y con contenido en columnas, con esto logras que el <footer> se pueda posicionar de arriba a abajo.

<body class="d-flex flex-column min-vh-100">

Lo último que deberías hacer es añadir la clase .mt-auto al elemento <footer>, es lo mismo que decir: margin-top: auto.

Y el resto lo realiza automático flexbox.

<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
</head>

<body class="d-flex flex-column min-vh-100">
  <h1>Hola</h1>

  <footer class="mt-auto footer bg-dark">
    <div class="copyright text-center text-light my-auto">
      <span>Proyecto - Gestion Clinica dental</span>
    </div>
  </footer>

</body>