2016-09-14 7 views
0

Ich möchte horizontale Bildlaufleiste angezeigt werden. Ich habe overflow-x:scroll; verwendet, aber ich sehe keine horizontale Bildlaufleiste. Bitte helfen Sie.Horizontale Bildlaufleiste fehlt

<div class="abc"> 
    <p>This is overflow-x scroll. This is overflow-x scroll. This is overflow-x scroll.</p> 
</div> 
.abc{ 
    overflow-x:scroll; 
    width:1000px; 
} 

Mein Code ist hier here

+0

Bitte fügen Sie den Code auf die Frage. Sie können den Jsbin auch in der Frage behalten. Der Grund für das Hinzufügen des Codes in einem Codeblock liegt darin, dass die jsbin-Verbindung in der Zukunft unterbrochen wird. Die Frage könnte einem zukünftigen Benutzer dennoch helfen. – Lexi

+0

Dies ist eine freiwillige Seite. Nenne keine Namen und erwarte keine Hilfe. Sie wählen basierend auf der Qualität der Frage. Siehe [hier] (http://stackoverflow.com/help/how-to-ask) – Lexi

Antwort

0

In Ihrem Beispiel sollten Sie die white-space Wert in Ihrem inneren div nowrap.

einen Blick auf den HTML-Code:

<!DOCTYPE html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width"> 
    <title>JS Bin</title> 
    </head> 
    <body> 
    <div class="a"> 
     <div class="scrollviewer"> 
      <p class="datacontainer">This is overflow-x scroll. This is overflow-x scroll. 
      <br/> 
      This is overflow-x scroll.This is overflow-x scroll.This is overflow-x scroll.This is overflow-x scroll.This is overflow-x scroll.This is overflow-x scroll.This is overflow-x scroll.This is overflow-x scroll.</p> 
     </div> 
    </div> 
    </body> 
</html> 

und die CSS:

.scrollviewer{ 
    overflow-x: scroll; 
    width:100%; 
} 
.datacontainer{ 
    white-space: nowrap; 
} 
Verwandte Themen