Stop div from overlapping

Rage A. Shadey

Ok so first things first. I have searched about this topic and did manage to find this:

Prevent floating DIVs from overlapping footer

However this did not solve my issue. I have also attempted other forms of rewriting the css code I have set but the results would in turn mess up my body content.

My index.php code:

<?php
session_start();
?>
<html>
<link rel="stylesheet" type="text/css" href="css/main.css">



<title>
Shadey Process


        </title>





<body>
<?php
include 'includes/header.php';
include 'includes/navigation.php';
?>

<div class="body">
This is the body.
Due to errors beyond my control everything I had worked so hard to do is gone.
</div>
<?php
include 'includes/footer.php';
?>
</body>


</html>

My main.css code:

@font-face { 
        font-family: Kingdom; src: url('../addons/font/Kingdom.ttf'); 
} 
.header {
    padding: 20px;
    color: red;
    text-align: center;
    border-bottom-style: solid;
    border-bottom-color: green;
    font-family: Kingdom;
    font-size: 98px;
}

body {
    background-color: black;
    
}
.body {

    color: red;
    margin-right: 34%;
}
.navlinks {
    float: left;
    width: 250px;
    length: 100%;
    background: black;
}
.footer {
  float: left;
  border-top-style: solid;
  border-top-color: green;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 20px;
  color: red;
  text-align: center;
  clear: both;
}

My navigation.php code:

<style>
.btn-group {
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    width: 150px;
    display: block;
    height: 100%;
    border-right-style: solid;
    border-right-color: green;
}

.button {
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    width: 80%;
    display: block;
}

.btn-group .button:not(:last-child) {
    border-bottom: none; /* Prevent double borders */
}


.home {
    background-color: black; 
    border: 1px solid red;
    color: red;
}
.home:hover {
    background-color:  	#800000; 
    border: 1px solid black;
    color: white;
}
.forum {
    background-color: black; /* Green */
    border: 1px solid green;
    color: green;
}
.forum:hover {
    background-color: #7CFC00; /* Green */
    border: 1px solid black;
    color: white;
}
.alpha {
    background-color: black; /* Green */
    border: 1px solid blue;
    color: blue;
}
.alpha:hover {
    background-color: #0000FF; /* Green */
    border: 1px solid black;
    color: white;
}
.games {
    background-color: black; /* Green */
    border: 1px solid yellow;
    color: yellow;
}
.games:hover {
    background-color: #FFFF00; /* Green */
    border: 1px solid black;
    color: black;
}
</style>





<div class="btn-group navlinks">

  <?php 
  if($_SESSION['user']==false)
    { 

      echo '
       <a href="index.php" class="button home">Home</a>
  <a href="forum.php" class="button forum">Forum</a>
  <a href="alpha.php" class="button alpha">Alpha</a>
  <a href="games.php" class="button games">Games</a> 
      <a href="includes/login/index.php" class="button home">Login</a>';
    }
  else{
      echo "<font color= 'red'>Glad to have you {$_SESSION["user"]}</font>";
      
      echo '
        <a href="index.php" class="button home">Home</a>
  <a href="forum.php" class="button forum">Forum</a>
  <a href="alpha.php" class="button alpha">Alpha</a>
  <a href="games.php" class="button games">Games</a>
      <a href="includes/logout/logout.php" class="button forum">Logout</a>';
    }
  ?>
  
  
  
  
  

</div>

My footer.php

<div class="footer", "container-fluid" style="bottom:0; position:fixed;">
<img style="-webkit-user-select: none;
background-position: 0px 0px, 10px 10px;
background-size: 20px 20px;
background-image:linear-gradient
(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%),
linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);" 
src="https://multicraft.mcprohosting.com/index.php?r=status/606439.png">
</div>

This is the rendered Html after using view source:

<html>
<link rel="stylesheet" type="text/css" href="css/main.css">



<title>
Shadey Process


        </title>





<body>
<div class="header">
Shadey Process
</div><style>
.btn-group {
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    width: 150px;
    display: block;
    height: 100%;
    border-right-style: solid;
    border-right-color: green;
}

.button {
    padding: 10px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    width: 80%;
    display: block;
}

.btn-group .button:not(:last-child) {
    border-bottom: none; /* Prevent double borders */
}


.home {
    background-color: black; 
    border: 1px solid red;
    color: red;
}
.home:hover {
    background-color:  	#800000; 
    border: 1px solid black;
    color: white;
}
.forum {
    background-color: black; /* Green */
    border: 1px solid green;
    color: green;
}
.forum:hover {
    background-color: #7CFC00; /* Green */
    border: 1px solid black;
    color: white;
}
.alpha {
    background-color: black; /* Green */
    border: 1px solid blue;
    color: blue;
}
.alpha:hover {
    background-color: #0000FF; /* Green */
    border: 1px solid black;
    color: white;
}
.games {
    background-color: black; /* Green */
    border: 1px solid yellow;
    color: yellow;
}
.games:hover {
    background-color: #FFFF00; /* Green */
    border: 1px solid black;
    color: black;
}
</style>





<div class="btn-group navlinks">

  
       <a href="index.php" class="button home">Home</a>
  <a href="forum.php" class="button forum">Forum</a>
  <a href="alpha.php" class="button alpha">Alpha</a>
  <a href="games.php" class="button games">Games</a> 
      <a href="includes/login/index.php" class="button home">Login</a>  
  
  
  
  

</div>
<div class="body">
This is the body.
Due to errors beyond my control everything I had worked so hard to do is gone.
</div>

<div class="footer", "container-fluid" style="bottom:0; position:fixed;">
<img style="-webkit-user-select: none;
background-position: 0px 0px, 10px 10px;
background-size: 20px 20px;
background-image:linear-gradient
(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%),
linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);" 
src="https://multicraft.mcprohosting.com/index.php?r=status/606439.png">
</div></body>


</html>

Any help and/or criticism would be greatly appreciated.

Sachith

You are trying to include your header file after </body> tag. include the <?php include 'includes/footer.php'; ?> footer withing your <body> tags

<?php
  session_start();
  ?>
<html>
  <link rel="stylesheet" type="text/css" href="css/main.css">
  <title>
    Shadey Process
  </title>
  <body>
    <?php
      include 'includes/header.php';
      include 'includes/navigation.php';
      ?>
    <div class="body">
      This is the body.
      Due to errors beyond my control everything I had worked so hard to do is gone.
    </div>
    <?php
      include 'includes/footer.php';
      ?>
  </body>
</html>

Updated (after read Mike's comment)

if still doesn't work this.i think problem is in your footer.php please post your footer.php here or put this code line to your footers div

<div class="container-fluid" style="bottom:0; position:fixed;">

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

CSS: Stop div and img from overlapping

From Dev

Stop floating DIVs from overlapping

From Dev

Stop errorbars from overlapping in matlab

From Dev

Stop ad from overlapping on last item of ListView

From Dev

How to stop <li> elements from overlapping?

From Dev

Preventing "child div" from overlapping the "parent div"

From Dev

How to avoid content from overlapping div border

From Dev

Prevent Absolute positioned Div from overlapping

From Dev

How to avoid content from overlapping div border

From Dev

How to stop an uitableview housed in tabbarcontrol from overlapping the status bar?

From Dev

Beginner's stuff: How to stop CSS' Divs from overlapping?

From Dev

How do I stop 2 divs from overlapping?

From Dev

stop d3 circle pack labels from overlapping

From Dev

How to stop these two divs/navbars from overlapping in Bootstrap

From Dev

How to stop these two divs/navbars from overlapping in Bootstrap

From Dev

prevent content div from overlapping header div when scrolling

From Dev

Stop background color of one div covering the content of another, rotated and thus overlapping, div

From Dev

Stop Div from going underneath other Div

From Dev

Div overlapping another div

From Dev

How do I avoid flash message div from overlapping

From Dev

CSS: How to prevent div from overlapping parent height or parent border

From Dev

How do I avoid flash message div from overlapping

From Dev

Stop div from sliding past the top of the page

From Dev

Stop children of a DIV from firing events

From Dev

Stop text from leaking out of div

From Dev

move div from left to right and then stop

From Dev

Stop div from wrapping around content?

From Dev

Stop div from sliding past the top of the page

From Dev

Stop text from leaking out of div

Related Related

  1. 1

    CSS: Stop div and img from overlapping

  2. 2

    Stop floating DIVs from overlapping

  3. 3

    Stop errorbars from overlapping in matlab

  4. 4

    Stop ad from overlapping on last item of ListView

  5. 5

    How to stop <li> elements from overlapping?

  6. 6

    Preventing "child div" from overlapping the "parent div"

  7. 7

    How to avoid content from overlapping div border

  8. 8

    Prevent Absolute positioned Div from overlapping

  9. 9

    How to avoid content from overlapping div border

  10. 10

    How to stop an uitableview housed in tabbarcontrol from overlapping the status bar?

  11. 11

    Beginner's stuff: How to stop CSS' Divs from overlapping?

  12. 12

    How do I stop 2 divs from overlapping?

  13. 13

    stop d3 circle pack labels from overlapping

  14. 14

    How to stop these two divs/navbars from overlapping in Bootstrap

  15. 15

    How to stop these two divs/navbars from overlapping in Bootstrap

  16. 16

    prevent content div from overlapping header div when scrolling

  17. 17

    Stop background color of one div covering the content of another, rotated and thus overlapping, div

  18. 18

    Stop Div from going underneath other Div

  19. 19

    Div overlapping another div

  20. 20

    How do I avoid flash message div from overlapping

  21. 21

    CSS: How to prevent div from overlapping parent height or parent border

  22. 22

    How do I avoid flash message div from overlapping

  23. 23

    Stop div from sliding past the top of the page

  24. 24

    Stop children of a DIV from firing events

  25. 25

    Stop text from leaking out of div

  26. 26

    move div from left to right and then stop

  27. 27

    Stop div from wrapping around content?

  28. 28

    Stop div from sliding past the top of the page

  29. 29

    Stop text from leaking out of div

HotTag

Archive