css - la hauteur adaptative div remplit automatiquement la hauteur restante
过去多啦不再A梦
过去多啦不再A梦 2017-05-31 10:40:40
0
3
1030

Les boîtes fixes nécessitent un positionnement absolu pour obtenir les effets suivants. J'espère qu'il existe des maîtres capables d'obtenir les méthodes suivantes sans positionnement absolu ! Merci de me donner quelques conseils

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

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
    html,
    body {
        height: 100%;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
    
    .outer {
        height: 100%;
        padding: 100px 0 0;
        box-sizing: border-box;
    }
    
    .A {
        height: 100px;
        background: #BBE8F2;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }
    
    .B {
        height: 100%;
        background: #D9C666;
        overflow: scroll;
    }
    </style>
</head>

<body>
    <p class="outer">
        <p class="A"> 头部p </p>
        <p class="B">
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdfD</p> <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdfD</p> <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdfD</p> <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdfD</p> <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdfD</p> <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdfD</p> <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>abcabsdf</p>
            <p>sssssssssssssssssssssss</p>

         </p>
    </p>
</body>

</html>
过去多啦不再A梦
过去多啦不再A梦

répondre à tous(3)
巴扎黑

La question est un peu vague. Si A+B doit être égal à la hauteur de l'extérieur, vous pouvez utiliser calc(100% - 100px);

.
PHPzhong

Positionnement fixe flottant

迷茫

Je ne comprends pas très bien ce que vous demandez. Pouvez-vous être plus précis ?

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!