/ / Horizontale Bildlaufleiste fehlt - HTML, CSS, horizontales Scrollen

Horizontale Scrollleiste fehlt - html, css, horizontal scrollen

Ich möchte, dass die horizontale Bildlaufleiste angezeigt wird. Ich habe benutzt overflow-x:scroll; aber ich sehe keine horizontale Bildlaufleiste. Bitte helfen Sie.

<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 hier ist Hier

Antworten:

2 für die Antwort № 1

Versuchen Sie dies entsprechend Ihrem Code in jsbin:

.abc{
overflow-x: auto;
white-space: nowrap;
}

Sie können eine dieser Optionen bei Bedarf auf "auto" oder "scroll" setzen.
Es gibt viele andere Eigenschaftswerte, überprüfen Sie hier: http://www.w3schools.com/cssref/pr_pos_overflow.asp


0 für die Antwort № 2

In deinem Beispiel solltest du den Weißraumwert so einstellen, dass er jetzt in deinem inneren Div rappt.

werfen Sie 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 das CSS:

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