2017-09-20 5 views
0

Wie mache ich ein Div in Vollbild mit Scroll? Dieser Code funktioniert, aber die scroollbar erscheint nicht:div in den Vollbildmodus mit Bildlauf

html:

<div id="full_screen"></div> 

css:

#full_screen { 
    position: fixed; 
    width: 100%; 
    height: 100%; 
    left: 0; 
    top: 0; 
    z-index: 10; 
} 
+0

try Überlauf hinzugefügt: blättern; zu deinem CSS –

Antwort

3

Verwenden overflow:scroll; die Schriftrolle zu zeigen. Da das Standardverhalten von scroll overflow:auto; ist.

#full_screen { 
 
    position: fixed; 
 
    width: 100%; 
 
    height: 100%; 
 
    left: 0; 
 
    top: 0; 
 
    z-index: 10; 
 
    background:red; 
 
    overflow:scroll; 
 
} 
 
.content{ 
 
    width: 1000px; 
 
    height: 1000px; 
 
}
<div id="full_screen"><div class="content"></div></div>

0
<div id="full_screen"></div> 

Hier ist die aktualisierte CSS. Wenn der Inhalt im div # -Full-Screen mehr ist, als er auf dem Bildschirm enthalten kann, wird ein Bildlauf angezeigt.

#full_screen { 
position: fixed; 
width: 100%; 
height: 100%; 
left: 0; 
right:0; 
bottom:0; 
top: 0; 
z-index: 10; 
overflow-y: scroll; 

}

Verwandte Themen