سؤال

My Padding doesn't work. I am using php and css. Below are the four files that are associated with it. Header.php, footer.php, index.php, stylesheet.css. I have tried adding

    Display: block;

Picture of exported code

Index.php:

    <?php include ('header.php') ?>
    <html>
        <head>
            <title>Armenian Genocide</title>
            <link rel="stylesheet" type="text/css" href="stylesheet.css">
        <body>
            <div id='content'>
            </div>
        </body>
    </html>
    <?php include ('footer.php') ?>

Header.php:

    <html>
        <head>
            <title>
                    Armenian Genocide
            </title>
        </head>
        <body>
            <div id='head'>
                <h1>HEADER</h1>
            </div>
        </body>
    </html>

Footer.php:

<html>
        <head>
            <title>
                    Armenian Genocide
            </title>
        </head>
        <body>
            <div id='footer'>
                <h1>FOOTER</h1>
            </div>
        </body>
    </html>

Stylesheet.css:

    body{
        background-image: url('images/background.jpg');
    }

    #head{
        width: 1380px;
        height: 100px;
        background-color: #FF0000;
        display: block;
        padding-left:25px;
        padding-right:25px;
        padding-top:25px;
        padding-bottom: 25px;
    }

    #content{
        width: 1380px;
        height: 800px;
        background-color: #5C8A8A;
        display: block;
        padding-left: 25px;
        padding-right: 25px;
    }

    #footer{
        width: 1380px;
        height: 100px;
        background-color: #253737;
        display: inline-block;
        padding-left: 25px;
        padding-top: 25px;
        padding-right: 25px;
    }
هل كانت مفيدة؟

المحلول

It might not working because you have multiple head, html and body.

It should be :

index.php

<html>
    <head>
        <title>Armenian Genocide</title>
        <link rel="stylesheet" type="text/css" href="stylesheet.css">
    <body>
        <?php include ('header.php') ?>
        <div id='content'>
        </div>
<?php include ('footer.php') ?>
    </body>
</html>

header.php

<div id='head'>
            <h1>HEADER</h1>
        </div>

footer.php

<div id='footer'>
            <h1>FOOTER</h1>
        </div>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top