Problem with include.php positioning

Asked

Viewed 391 times

2

I’m having a problem with the positioning of the footer I made with include.php.

I created a file include.php, for now the only thing that has in it is a box where the footer will be, because I’m still testing.

I’m calling him at the end of every page, always before the body.

<?php include "rodape.php"; ?> 

The problem is that in only one of the pages it is positioned at the end, in the others it appears in several places, at the top, further down a little, and in others it doesn’t even appear.

Someone would know to tell me what it could be, if you need an excerpt from the code I can put here.

--> The html of one of the pages giving the problem:

<!DOCTYPE HTML>
<html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>

    <Title>Portfolio - Julio Cesar </title>

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

    <link href='http://fonts.googleapis.com/css?family=Lato:400,700,900,300,100' rel='stylesheet' type='text/css'>

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:700,400' rel='stylesheet' type='text/css'>

    <!--
    <script type="text/javascript" src="javaScript.js"></script>
    -->
</head>
<body>

    <div class="Conteiner"> <!--- INICIO CONTEINER-->   

    <header>    

        <div class="meu_logo">
            <a href="Index.php">Julio Cesar</a>
        </div>  

        <div id="caixatopo"></div>  


        <nav class="menu">
        <ul>
            <li><a href="projetos.php">Projetos</a></li>
            <li><a href="Process.php">Processo</a></li>
            <li><a href="About.php">Sobre</a></li>
            <li><a href="Contact.php">Contato</a></li>
        </ul>
        </nav>

    </header>   

        <div class="titulo_proclinica">
            <p>FATOR CLEAN <p>
        </div>


        <div class="categoria_fclean">
            <p>Web Design<p>
        </div>

        <div class="fator_imac1">
            <img src="imagens/fator_celan/fator imac1.png" />
        </div>  

        <div class="fator_imac2">
            <img src="imagens/fator_celan/fator imac2.png" />
        </div>  

        <div class="boxmarrom_1"></div>

        <div class="icones">
            <img src="imagens/fator_celan/icones.png" width="960px"  height:"auto"/>
        </div>

        <div class="fator_imac3">
            <img src="imagens/fator_celan/fator imac3.png" />
        </div>
    </div> <!--- FIM CONTEINER-->


    <?php include 'rodape.php'; ?>
</body>  

The code of the include file:

<div class="box_rodape"></div>

The CSS of the site is great, I don’t know if I could put it here.

--> CSS of the footer, which is the div class box_rodape:

.box_rodape {
     background-color: rgb( 250, 31, 32 );
     left: 0;
     width: 960px;
     height: 300px;
     z-index:9999;   
}
  • 1

    Yes, add the code snippet so we can see how you’re doing.

  • 1

    It seems to be a problem of positioning the elements present in the footer and not a problem of including the file in the various pages. That is, the CSS on some pages is not compatible with your footer element and it is not visible on the page despite being present in the source code. You scanned the page’s source code after opening it in the browser?

  • So @Zuul, I took a look and found nothing, from a look at the css of the footer element, it’s just a red box for now, besides, on one of the pages, on the index, it’s appearing normally.

  • @Juliocesar Compare the index to the other pages and see if there are differences in include.

  • @Juliocesar Can you specify what the footer file has? And if you can also show the CSS.

  • @Zuul The.php footer is just this: <div class="box_footer"></div> And the css of this div is this: . box_footer { background-color: rgb( 250, 31, 32 ); left: 0; width: 960px; height: 300px; position: Absolute; z-index:9999; ;}

Show 1 more comment

1 answer

1

The CSS you posted does not say whether the box has relative or absolute position or any other.

Z-index only works if a position is declared. And if it is position: absolute should be relative to his father who must have a position: relative.

If the body for your relative you can try 2 things:

  1. One is to give a height: 100% in the body
  2. The other, the most recommended, is you use a technique called Stick-Footer. Play this on Google and you’ll learn in no time.
  • Thank you @dsantoro, I’ll take a look, thanks.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.