Css: overflow scroll funktioniert nicht
Ich bin tring zu setzen-overflow-scroll-Eigenschaft in ein div, um zu zeigen, dass eine scroll-Leiste für den Benutzer, aber es funktioniert nicht.
Ich weiß nicht, wo das problem ist.
Mein code ist hier : http://fiddle.jshell.net/Gg9dL/
Hier ist der HTML :
<div class="col">
<div class="box-5">
<div class="box-menu">
<img src="src/ui_dashboard/img/ic_action_twitter.png" id="imgIntoMenu"><span id="textMenu">Tweets from</span>
<div class="listTweets">
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
<div class="tweetItem" id="tweetItem">toto</div>
</div>
</div>
</div>
</div>
Und hier das CSS :
.col {
float: left;
width: 33%;
margin: 0;
padding: 0;
}
.containerBloc {
max-width: 1200px;
margin: 0 auto;
overflow: hidden;
margin-top: 280px;
}
.box-1,.box-2,.box-3,.box-4 {
margin: 1%;
min-height: 150px;
box-sizing: border-box;
-moz-box-sizing: border-box;
background-color: #FFFFFF;
border: 1px solid #B0B0B0;
}
.box-1,.box-2 {
height: 200px;
}
.box-1,.box-3 {
width: 98%;
height: 350px;
}
.box-2,.box-4 {
width: 98%;
height: 200px;
}
.box-5 {
margin: 1%;
min-height: 150px;
box-sizing: border-box;
-moz-box-sizing: border-box;
background-color: #FFFFFF;
border: 1px solid #B0B0B0;
float: right;
height: 204px;
width: 98%;
}
.box-menu {
background-color: #EFEFEF;
height: 40px;
color: #B0B0B0;
border-bottom: 1px solid #B0B0B0;
}
#imgIntoMenu {
margin-left: 10px;
margin-top: 4px;
}
#textMenu {
margin-left: 10px;
position: absolute;
margin-top: 10px;
font-family: 'Roboto', sans-serif;
font-size: 11pt;
}
.tweetItem{
background-color: blue;
margin-top: 2px;
margin-left: 2px;
margin-right: 2px;
height: 70px;
}
.listTweets {
overflow : scroll;
}
InformationsquelleAutor der Frage wawanopoulos | 2014-01-02
Du musst angemeldet sein, um einen Kommentar abzugeben.
Musst du eine Höhe für das div-sonst wird es erweitern, um die Höhe des Inhalts
http://fiddle.jshell.net/Gg9dL/1/
InformationsquelleAutor der Antwort Musa
Müssen Sie eine explizite Höhe zu Ihr .listTweets
Aktualisiert Beispiel: http://fiddle.jshell.net/Gg9dL/3/
InformationsquelleAutor der Antwort veddermatic
Overflow: hidden versteckt alles, was sich außerhalb des sichtbaren Bereichs. Verwenden overflow:scroll zum anzeigen der scrollbars. Wenn Sie möchten, dass eine bestimmte Bildlaufleiste anzeigen, verwenden overflow-x oder overflow-y.
InformationsquelleAutor der Antwort Michal